/* [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','7901',jdecode('Home'),jdecode(''),'/7901.html','true',[],'',''],
	['PAGE','7952',jdecode('Massage+News'),jdecode(''),'/7952/index.html','true',[ 
		['PAGE','10501',jdecode('Event+Massage'),jdecode(''),'/7952/10501.html','true',[],'','']
	],'',''],
	['PAGE','8601',jdecode('About+Massage'),jdecode(''),'/8601/index.html','true',[ 
		['PAGE','8627',jdecode('Sports+Massage'),jdecode(''),'/8601/8627.html','true',[],'',''],
		['PAGE','14501',jdecode('Remedial+Massage'),jdecode(''),'/8601/14501.html','true',[],'',''],
		['PAGE','58301',jdecode('Injury+Prevention'),jdecode(''),'/8601/58301.html','true',[],'',''],
		['PAGE','26501',jdecode('Injury+Rehabilitation'),jdecode(''),'/8601/26501.html','true',[],'',''],
		['PAGE','61601',jdecode('Enhancing+Recovery'),jdecode(''),'/8601/61601.html','true',[],'',''],
		['PAGE','21101',jdecode('Frequently+Asked+Questions'),jdecode(''),'/8601/21101.html','true',[],'',''],
		['PAGE','27101',jdecode('Testimonials'),jdecode(''),'/8601/27101.html','true',[],'','']
	],'',''],
	['PAGE','11101',jdecode('Location'),jdecode(''),'/11101.html','true',[],'',''],
	['PAGE','8379',jdecode('Prices'),jdecode(''),'/8379.html','true',[],'',''],
	['PAGE','56901',jdecode('Clinic+Hours'),jdecode(''),'/56901.html','true',[],'',''],
	['PAGE','8030',jdecode('Other+Services'),jdecode(''),'/8030/index.html','true',[ 
		['PAGE','8901',jdecode('Strapping+%26+Taping'),jdecode(''),'/8030/8901.html','true',[],'',''],
		['PAGE','8953',jdecode('Stretching'),jdecode(''),'/8030/8953.html','true',[],'',''],
		['PAGE','8927',jdecode('Personal+Run+Coaching'),jdecode(''),'/8030/8927.html','true',[],'',''],
		['PAGE','54201',jdecode('Running+Questionaire'),jdecode(''),'/8030/54201.html','true',[],'','']
	],'',''],
	['PAGE','7978',jdecode('Contact+Me'),jdecode(''),'/7978.html','true',[],'',''],
	['PAGE','8757',jdecode('Links'),jdecode(''),'/8757.html','true',[],'',''],
	['PAGE','8004',jdecode('Shop'),jdecode(''),'/8004.html','true',[],'',''],
	['PAGE','8056',jdecode('Tim+Sutton+Fowlmead+5'),jdecode(''),'/8056/index.html','true',[ 
		['PAGE','47001',jdecode('Results+2009'),jdecode(''),'/8056/47001.html','true',[],'',''],
		['PAGE','8134',jdecode('Results+2008'),jdecode(''),'/8056/8134.html','true',[],'','']
	],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='Sportfan2';
theSitetree.paletteFamily='FDEDC0';
theSitetree.keyvisualId='10132';
theSitetree.keyvisualName='kv_10132.jpg';
theSitetree.fontsetId='21089';
theSitetree.graphicsetId='13186';
theSitetree.contentColor='B51818';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Sportfan2',
				paletteFamily: 	'FDEDC0',
				keyvisualId: 	'10132',
				keyvisualName: 	'kv_10132.jpg',
				fontsetId: 		'21089',
				graphicsetId: 	'13186',
				contentColor: 	'B51818',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7901',
internalId:  '',
customField: '20100804-090114'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7978',
internalId:  '',
customField: '20081024-134144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56901',
internalId:  '',
customField: '20100617-132526'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8379',
internalId:  '',
customField: '20091105-133730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8030',
internalId:  '',
customField: '20100831-104551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8601',
internalId:  '',
customField: '20091113-183557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7952',
internalId:  '',
customField: '20100827-112715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8004',
internalId:  '',
customField: '20100724-144428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8927',
internalId:  '',
customField: '20090624-084458'
};
webappMappings['7008']=webappMappings['7008-2610']={
webappId:    '7008',
documentId:  '8953',
internalId:  '2610',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61601',
internalId:  '',
customField: '20091201-163737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8056',
internalId:  '',
customField: '20100221-174159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8134',
internalId:  '',
customField: '20081113-122916'
};
webappMappings['7008']=webappMappings['7008-2250']={
webappId:    '7008',
documentId:  '7978',
internalId:  '2250',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26501',
internalId:  '',
customField: '20090825-143733'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11101',
internalId:  '',
customField: '20090627-081353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8627',
internalId:  '',
customField: '20081024-133025'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8757',
internalId:  '',
customField: '20100617-131922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58301',
internalId:  '',
customField: '20090825-145658'
};
webappMappings['1501']=webappMappings['1501-7100825']={
webappId:    '1501',
documentId:  '7901',
internalId:  '7100825',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10501',
internalId:  '',
customField: '20100831-134133'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14501',
internalId:  '',
customField: '20081024-133053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8901',
internalId:  '',
customField: '20081024-133926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8953',
internalId:  '',
customField: '20100831-134818'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54201',
internalId:  '',
customField: '20090825-150004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21101',
internalId:  '',
customField: '20081024-133311'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27101',
internalId:  '',
customField: '20090713-144116'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '7901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47001',
internalId:  '',
customField: '20090226-140050'
};
webappMappings['7008']=webappMappings['7008-4991']={
webappId:    '7008',
documentId:  '54201',
internalId:  '4991',
customField: 'language:en;country:GB;'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INEM61';
var companyName   = 'Tim+Sutton+Sports+Massage%2C+Deal%2C+01304+366248';
var htmlTitle	  = 'Tim+Sutton+Sports+%26+Remedial+Massage';
var metaKeywords  = 'back+pain%2C+frozen+shoulder%2C+runners+knee%2C+tennis+elbow%2C+planter+fascia%2C+shin+splints%2C+back+ache%2C+rye+neck%2C+stiff+joints%2C+neck+pain%2C+headaches%2C+golfers+elbow';
var metaContents  = 'Sports++Remedial+can+help+you+with+back+pain%2C+frozen+shoulder%2C+runners+knee%2C+tennis+elbow++planter+fascia+along+with+all+other+soft+tissue+problems+that+can+effect+your+muscles%2C+tendons++ligaments.These+may+be+caused+by+manual+labour%2C+office+work%2C+gardening++driving+etc%21';
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();
};
