/* [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','6101',jdecode('Home'),jdecode(''),'/6101.html','true',[],'',''],
	['PAGE','6173',jdecode('About+Pilates'),jdecode(''),'/6173.html','true',[],'',''],
	['PAGE','6152',jdecode('Who+We+Are'),jdecode(''),'/6152.html','true',[],'',''],
	['PAGE','13701',jdecode('Benefits+of+Pilates'),jdecode(''),'/13701.html','true',[],'',''],
	['PAGE','12401',jdecode('Classes'),jdecode(''),'/12401/index.html','true',[ 
		['PAGE','12422',jdecode('Remedial%2FRehabilitation'),jdecode(''),'/12401/12422.html','true',[],'',''],
		['PAGE','12443',jdecode('General+Fitness'),jdecode(''),'/12401/12443.html','true',[],'',''],
		['PAGE','12464',jdecode('Pre%2FPost+Natal'),jdecode(''),'/12401/12464.html','true',[],'','']
	],'',''],
	['PAGE','14201',jdecode('Studio+Timetable'),jdecode(''),'/14201.html','true',[],'',''],
	['PAGE','12485',jdecode('Class+Prices'),jdecode(''),'/12485.html','true',[],'',''],
	['PAGE','17801',jdecode('Photo+Album'),jdecode(''),'/17801.html','true',[],'',''],
	['PAGE','12506',jdecode('Testimonials'),jdecode(''),'/12506.html','true',[],'',''],
	['PAGE','12527',jdecode('Contact+'),jdecode(''),'/12527.html','true',[],'',''],
	['PAGE','13001',jdecode('Directions'),jdecode(''),'/13001.html','true',[],'',''],
	['PAGE','12569',jdecode('Links'),jdecode(''),'/12569.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Round';
theSitetree.paletteFamily='669999';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='441';
theSitetree.graphicsetId='497';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='a1c6c6';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Round',
				paletteFamily: 	'669999',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'441',
				graphicsetId: 	'497',
				contentColor: 	'FFFFFF',
				contentBGColor: 'a1c6c6',
				a_color: 		'a1c6c6',
				b_color: 		'669999',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6101',
internalId:  '',
customField: '20080226-203539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6152',
internalId:  '',
customField: '20100311-135808'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6173',
internalId:  '',
customField: '20080226-205507'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12401',
internalId:  '',
customField: '20100311-134345'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12422',
internalId:  '',
customField: '20080306-151231'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13701',
internalId:  '',
customField: '20080119-150145'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '13001',
internalId:  'location',
customField: 'language:en;country:GB;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12485',
internalId:  '',
customField: '20100311-134714'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12443',
internalId:  '',
customField: '20080306-151142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14201',
internalId:  '',
customField: '20100311-134328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12527',
internalId:  '',
customField: '20100125-144218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13001',
internalId:  '',
customField: '20080118-132638'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12569',
internalId:  '',
customField: '20080118-153936'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12464',
internalId:  '',
customField: '20080306-151401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12506',
internalId:  '',
customField: '20080118-131928'
};
webappMappings['7060']=webappMappings['7060-8ce301f4b487e8f6322b807955b09254']={
webappId:    '7060',
documentId:  '17801',
internalId:  '8ce301f4b487e8f6322b807955b09254',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17801',
internalId:  '',
customField: '20080123-110945'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6101',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN2R1X';
var companyName   = 'Windsor+Pilates+Studio';
var htmlTitle	  = 'Windsor+Pilates+Studio';
var metaKeywords  = '';
var metaContents  = '';
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();
};
