/* [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','501',jdecode('HOME'),jdecode(''),'/501.html','true',[],''],
	['PAGE','552',jdecode('Fitness+STUDIO'),jdecode(''),'/552.html','true',[],''],
	['PAGE','17301',jdecode('GYM+of+OUTDOORS'),jdecode(''),'/17301.html','true',[],''],
	['PAGE','18929',jdecode('Pre-SKI'),jdecode(''),'/18929.html','true',[],''],
	['PAGE','573',jdecode('TESTIMONIALS'),jdecode(''),'/573.html','true',[],''],
	['PAGE','594',jdecode('Oakleafe+Rambling'),jdecode(''),'/594.html','true',[],''],
	['PAGE','615',jdecode('Contact+Us'),jdecode(''),'/615.html','true',[],'']];
var siteelementCount=7;
theSitetree.topTemplateName='Madison';
theSitetree.paletteFamily='8ED4AA';
theSitetree.keyvisualId='3454';
theSitetree.keyvisualName='kv_3454.jpg';
theSitetree.fontsetId='10434';
theSitetree.graphicsetId='10780';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				name: 			'Madison',
				paletteFamily: 	'8ED4AA',
				keyvisualId: 	'3454',
				keyvisualName: 	'kv_3454.jpg',
				fontsetId: 		'10434',
				graphicsetId: 	'10780',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'8ED4AA',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'8ED4AA',
				e_color: 		'ACABAB',
				f_color: 		'626161',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100103-230910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20100102-173703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20100102-175854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '594',
internalId:  '',
customField: '20100102-180530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17301',
internalId:  '',
customField: '20100102-174927'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '615',
internalId:  '',
customField: '20100102-181025'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18929',
internalId:  '',
customField: '20100102-175359'
};
webappMappings['1501']=webappMappings['1501-10965602']={
webappId:    '1501',
documentId:  '501',
internalId:  '10965602',
customField: '1501'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10INXHW9';
var companyName   = 'WINDOVER+FITNESS';
var htmlTitle	  = 'Windover+Personal+Training+Studio+%3A+a+stunning+location+in+the+Cuckmere+Valley+%3A+probably+the+most+EXCLUSIVE+personal+fitness+centre+in+East+Sussex';
var metaKeywords  = 'Windover%2C+Fitness%2C+personal%2C+training%2C+exercise%2C+fitness%2C+nutrition%2C+LIFEafterFORTY%2C+life%2C+after%2C+forty%2C+trainer%2C+Power-Plate%2C+powerplate%2C+Power%2C+Plate%2C+vibrogym%2C+concept2%2C+Nordic%2C+walking%2C+studio%2C+east%2C+Sussex%2C+nrpt%2C+reps%2C+REPs%2C+aerobic%2C+workout%2C+Milokit';
var metaContents  = 'Windover+Fitness%2C+the+personal+training+STUDIO+and+GYM+OF+THE+OUTDOORS+set+in+the+heart+of+the+Cuckmere+Valley+in+East+Sussex.++In+the+hamlet+of+Milton+Street+near+Alfriston%2C+this+fitness+Studio+is+exclusively+for+Personal+Training+one-to-one+sessions+or+for+small+groups+%28at+most+3%29.++Probably+the+most+exclusive+personal+fitness+studio+in+East+Sussex%2C+by+virtue+of+its+position%3B+and+the+fact+that+it+is+a+POWER+PLATE+studio.++Indoor+and+outdoor+training+environments+%3A+Exercise+Anywhere+...+but+first+try+out+%3A+THE+WINDOVER+PERSONAL+TRAINING+STUDIO';
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();
};
