/* [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','280756',jdecode('Tall+Ships+2011'),jdecode(''), jdecode('%2F280756.html'), 'true',[],'',''],
	['PAGE','118712',jdecode('Clipper+09-10'),jdecode(''), jdecode('%2F118712%2Findex.html'), 'true',[ 
		['PAGE','1001',jdecode('Clipper+Training'),jdecode(''), jdecode('%2F118712%2F1001.html'), 'true',[],'','']
	],'',''],
	['PAGE','84712',jdecode('+Race+Blog'),jdecode(''), jdecode('%2F84712.html'), 'true',[],'',''],
	['PAGE','47812',jdecode('About+Andy+Milner'),jdecode(''), jdecode('%2F47812.html'), 'true',[],'',''],
	['PAGE','1052',jdecode('The+Route'),jdecode(''), jdecode('%2F1052%2Findex.html'), 'true',[ 
		['PAGE','1073',jdecode('Leg+1+Hull+to+Rio+de+Janeiro'),jdecode(''), jdecode('%2F1052%2F1073.html'), 'false',[],'',''],
		['PAGE','1094',jdecode('Leg+2+Rio+de+Janeiro+to+Cape+Town'),jdecode(''), jdecode('%2F1052%2F1094.html'), 'false',[],'',''],
		['PAGE','1115',jdecode('Leg+3+Cape+Town+To+W+Australia'),jdecode(''), jdecode('%2F1052%2F1115.html'), 'false',[],'',''],
		['PAGE','1136',jdecode('Leg+4+W+Australia+to+Qingdao'),jdecode(''), jdecode('%2F1052%2F1136.html'), 'false',[],'',''],
		['PAGE','1157',jdecode('Leg+5+Qingdao+to+California'),jdecode(''), jdecode('%2F1052%2F1157.html'), 'false',[],'',''],
		['PAGE','1178',jdecode('Leg+6+California+to+Jamaica'),jdecode(''), jdecode('%2F1052%2F1178.html'), 'false',[],'',''],
		['PAGE','1199',jdecode('Leg+7+Jamaica+to+Hull'),jdecode(''), jdecode('%2F1052%2F1199.html'), 'false',[],'','']
	],'',''],
	['PAGE','157023',jdecode('The+Fleet'),jdecode(''), jdecode('%2F157023.html'), 'true',[],'',''],
	['PAGE','80712',jdecode('+Schools+Section'),jdecode(''), jdecode('%2F80712%2Findex.html'), 'true',[ 
		['PAGE','81612',jdecode('Ask+Andy'),jdecode(''), jdecode('%2F80712%2F81612.html'), 'true',[],'',''],
		['PAGE','82412',jdecode('Education+Videos'),jdecode(''), jdecode('%2F80712%2F82412.html'), 'false',[],'','']
	],'',''],
	['PAGE','133423',jdecode('Published+Articles'),jdecode(''), jdecode('%2F133423.html'), 'true',[],'',''],
	['PAGE','8401',jdecode('Pictures'),jdecode(''), jdecode('%2F8401.html'), 'true',[],'',''],
	['PAGE','1451',jdecode('Diary'),jdecode(''), jdecode('%2F1451.html'), 'true',[],'',''],
	['PAGE','17006',jdecode('Message+Board'),jdecode(''), jdecode('%2F17006%2Findex.html'), 'true',[ 
		['PAGE','17001',jdecode('Read+Guestbook'),jdecode(''), jdecode('%2F17006%2F17001.html'), 'false',[],'','']
	],'',''],
	['PAGE','1472',jdecode('Corporate+Partnerships'),jdecode(''), jdecode('%2F1472.html'), 'false',[],'',''],
	['PAGE','1493',jdecode('Charitable+Sponsorship'),jdecode(''), jdecode('%2F1493.html'), 'true',[],'',''],
	['PAGE','1514',jdecode('Useful+Links'),jdecode(''), jdecode('%2F1514.html'), 'true',[],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='Global';
theSitetree.paletteFamily='0E6C84';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='85';
theSitetree.graphicsetId='106';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'GB'
};
var prodDef={
  wl_name: 'easily_co_uk',
  product: 'WSCSYSSSSLY0XVDH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Global',
				paletteFamily: 	'0E6C84',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'85',
				graphicsetId: 	'106',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'0E6C84',
				b_color: 		'FFE151',
				c_color: 		'000000',
				d_color: 		'E6EEF1',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1001',
internalId:  '',
customField: '20110101-232945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '133423',
internalId:  '',
customField: '20101027-095826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1052',
internalId:  '',
customField: '20110107-163510'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1073',
internalId:  '',
customField: '20090715-095004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1094',
internalId:  '',
customField: '20090611-202445'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1115',
internalId:  '',
customField: '20090715-095027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1136',
internalId:  '',
customField: '20090422-165711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1157',
internalId:  '',
customField: '20090422-165835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1178',
internalId:  '',
customField: '20090705-191217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1199',
internalId:  '',
customField: '20090715-095101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84712',
internalId:  '',
customField: '20080817-223442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80712',
internalId:  '',
customField: '20100708-070349'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47812',
internalId:  '',
customField: '20080501-201632'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '157023',
internalId:  '',
customField: '20110211-205857'
};
webappMappings['1003']=webappMappings['1003-anbt10in2j0h1184d153ae6']={
webappId:    '1003',
documentId:  '81612',
internalId:  'anbt10in2j0h1184d153ae6',
customField: 'en:GB:'
};
webappMappings['1002']=webappMappings['1002-17006anbt10in2j0h']={
webappId:    '1002',
documentId:  '17006',
internalId:  '17006anbt10in2j0h',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '280756',
internalId:  '',
customField: '20110717-103248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17006',
internalId:  '',
customField: '20080825-165020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1451',
internalId:  '',
customField: '20110207-192204'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1472',
internalId:  '',
customField: '20080321-083337'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1493',
internalId:  '',
customField: '20090605-103530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1514',
internalId:  '',
customField: '20101028-204644'
};
webappMappings['7060']=webappMappings['7060-64b9b81cf988ada59472cae4204f0c65']={
webappId:    '7060',
documentId:  '8401',
internalId:  '64b9b81cf988ada59472cae4204f0c65',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8401',
internalId:  '',
customField: '20090126-225454'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81612',
internalId:  '',
customField: '20080716-211034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82412',
internalId:  '',
customField: '20081211-103242'
};
webappMappings['7050']=webappMappings['7050-212']={
webappId:    '7050',
documentId:  '84712',
internalId:  '212',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17001',
internalId:  '',
customField: '20071015-221045'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '280756',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '118712',
internalId:  '',
customField: '20110105-221342'
};
webappMappings['1501']=webappMappings['1501-3430613']={
webappId:    '1501',
documentId:  '280756',
internalId:  '3430613',
customField: '1501'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN2J0H';
var companyName   = 'Meridian360+-+Andy+Milner';
var htmlTitle	  = 'Meridian360';
var metaKeywords  = 'andy%2C+milner%2C+clipper%2C+round%2C+world%2C+meridian%2C+360%2C+yacht%2C+rainbow%2C+09-10%2C+sailing%2C+race%2C+';
var metaContents  = 'Clipper+Round+the+World+Race+09-10';
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();
};

