/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','95401',jdecode('News+Reel'),jdecode(''),'/95401.html','true',[],'',''],
	['PAGE','91801',jdecode('Luso+Mundo'),jdecode(''),'/91801.html','true',[],'',''],
	['PAGE','17201',jdecode('Economy'),jdecode(''),'/17201/index.html','true',[ 
		['PAGE','75001',jdecode('Bernanke+put'),jdecode(''),'/17201/75001.html','true',[],'',''],
		['PAGE','76601',jdecode('Subprime'),jdecode(''),'/17201/76601.html','true',[],'',''],
		['PAGE','16801',jdecode('Recession'),jdecode(''),'/17201/16801.html','true',[],'',''],
		['PAGE','17222',jdecode('China+-+overvalued%3F'),jdecode(''),'/17201/17222.html','true',[],'','']
	],'',''],
	['PAGE','515',jdecode('Business'),jdecode(''),'/515/index.html','true',[ 
		['PAGE','9901',jdecode('Start+ups'),jdecode(''),'/515/9901.html','true',[],'','']
	],'',''],
	['PAGE','19801',jdecode('West+Coast'),jdecode(''),'/19801/index.html','true',[ 
		['PAGE','21401',jdecode('Visiting'),jdecode(''),'/19801/21401.html','true',[],'','']
	],'',''],
	['PAGE','21485',jdecode('Properties'),jdecode(''),'/21485.html','true',[],'',''],
	['PAGE','21422',jdecode('Golf'),jdecode(''),'/21422/index.html','true',[ 
		['PAGE','66601',jdecode('Golf+Courses'),jdecode(''),'/21422/66601.html','true',[],'','']
	],'',''],
	['PAGE','21443',jdecode('Equestrian+Sports'),jdecode(''),'/21443/index.html','true',[ 
		['PAGE','62801',jdecode('The+Lusitano'),jdecode(''),'/21443/62801.html','true',[],'','']
	],'',''],
	['PAGE','65101',jdecode('Sailing-Surfing'),jdecode(''),'/65101/index.html','true',[ 
		['PAGE','66301',jdecode('Yacht+Clubs'),jdecode(''),'/65101/66301.html','true',[],'','']
	],'',''],
	['PAGE','101901',jdecode('Job+listings'),jdecode(''),'/101901.html','true',[],'',''],
	['PAGE','599',jdecode('Contact+us'),jdecode(''),'/599.html','true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Food';
theSitetree.paletteFamily='494EB3';
theSitetree.keyvisualId='7626';
theSitetree.keyvisualName='kv_7626.jpg';
theSitetree.fontsetId='16717';
theSitetree.graphicsetId='12244';
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: 			'Food',
				paletteFamily: 	'494EB3',
				keyvisualId: 	'7626',
				keyvisualName: 	'kv_7626.jpg',
				fontsetId: 		'16717',
				graphicsetId: 	'12244',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20091205-204348'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9901',
internalId:  '',
customField: '20091025-123540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '101901',
internalId:  '',
customField: '20090801-183226'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20091025-123451'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21422',
internalId:  '',
customField: '20080907-195723'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '599',
internalId:  '',
customField: '20080405-205827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62801',
internalId:  '',
customField: '20080223-170852'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19801',
internalId:  '',
customField: '20080907-173511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21401',
internalId:  '',
customField: '20080907-200542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16801',
internalId:  '',
customField: '20080908-232836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17201',
internalId:  '',
customField: '20100105-113148'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17222',
internalId:  '',
customField: '20080514-214328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21443',
internalId:  '',
customField: '20080907-135716'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21485',
internalId:  '',
customField: '20080907-175324'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95401',
internalId:  '',
customField: '20091224-092637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65101',
internalId:  '',
customField: '20080907-203401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66301',
internalId:  '',
customField: '20080907-203444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76601',
internalId:  '',
customField: '20080514-214037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66601',
internalId:  '',
customField: '20091205-204256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91801',
internalId:  '',
customField: '20090322-185122'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75001',
internalId:  '',
customField: '20080514-213930'
};
webappMappings['7008']=webappMappings['7008-675']={
webappId:    '7008',
documentId:  '599',
internalId:  '675',
customField: 'language:en;country:GB;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN2DRS';
var companyName   = 'One+Man+Standing';
var htmlTitle	  = 'One+Man+Standing';
var metaKeywords  = 'Investments%2C+finance%2C+horses%2C+equestrian%2C+golf%2C+sailing%2Cproperty%2C+nature%2C+templar%2C+knights%2C+politics%2C++enviroment%2C+start+ups%2C+environment%2C+strategy%2C+strategic%2C+golf%2C+equestrian%2C+Portugal%2C+West+Coast%2C+Lusitano%2C+show+jumping%2C+polo%2C+yachts%2C+saddles%2C+dressage';
var metaContents  = 'One+Man+Standing+brings+you+global+insights+with+a+West+Coast+perspective.+It+might+be+lonely+at+the+top%2C+but+at+least+you+can+read+One+Man+Standing.Keeping+you+up+to+date+with+the+latest+financial+analysis%2C+stock+insights+but+as+life+is+not+just+work+we+also+bring+you+the+best+golf+courses%2C+sailing%2C+equestrian+sports+and+properties+too%21+Popular+opinion+-+mass+opinion.+It+drives+the+market+and+exerts+an+unstoppable+magnetic+pull+than+drives+everyone+to+its+core.+But+its+not+always+right+-+Current+trends+in+business%2C+religion%2C+politics+and+the+environment..+Help+start+up+businesses+raise+cash.+Help+the+investor+to+evaluate+his+investments.+Help+business+managers+develop+new+businesses.+Help+business+managers+and+CEO+to+set+up+a+strategic+plan+for+their+business.+';
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();
};
