/* [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','3101',jdecode('Home+Page'),jdecode(''),'/3101.html','true',[],'',''],
	['PAGE','1531',jdecode('Profile'),jdecode(''),'/1531.html','true',[],'',''],
	['PAGE','3812',jdecode('Topics'),jdecode(''),'/3812.html','true',[],'',''],
	['PAGE','4412',jdecode('After+Dinner+'),jdecode(''),'/4412.html','true',[],'',''],
	['PAGE','4212',jdecode('Client+List'),jdecode(''),'/4212.html','true',[],'',''],
	['PAGE','4723',jdecode('Testimonies'),jdecode(''),'/4723.html','true',[],'',''],
	['PAGE','4923',jdecode('Press+Releases'),jdecode(''),'/4923.html','true',[],'',''],
	['PAGE','5123',jdecode('Cruise+Ship+Speakers'),jdecode(''),'/5123.html','true',[],'',''],
	['PAGE','5323',jdecode('Voice+Training'),jdecode(''),'/5323.html','true',[],'',''],
	['PAGE','5523',jdecode('Voice+Over'),jdecode(''),'/5523.html','true',[],'',''],
	['PAGE','5723',jdecode('Publication'),jdecode(''),'/5723.html','true',[],'',''],
	['PAGE','5923',jdecode('Contact'),jdecode(''),'/5923.html','true',[],'',''],
	['PAGE','1510',jdecode(''),jdecode(''),'/1510.html','true',[],'',''],
	['PAGE','1573',jdecode('My+Blog'),jdecode(''),'/1573.html','true',[],'',''],
	['PAGE','1584',jdecode('Guestbook'),jdecode(''),'/1584.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Bigcity_Sydney';
theSitetree.paletteFamily='333333';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='21081';
theSitetree.graphicsetId='13173';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333333';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Bigcity_Sydney',
				paletteFamily: 	'333333',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'21081',
				graphicsetId: 	'13173',
				contentColor: 	'FFFFFF',
				contentBGColor: '333333',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['7050']=webappMappings['7050-3500']={
webappId:    '7050',
documentId:  '1573',
internalId:  '3500',
customField: 'language:en;country:GB;'
};
webappMappings['7002']=webappMappings['7002-3240']={
webappId:    '7002',
documentId:  '1584',
internalId:  '3240',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1510',
internalId:  '',
customField: '20100117-160046'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1531',
internalId:  '',
customField: '20100614-214030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1573',
internalId:  '',
customField: '20100117-160046'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1584',
internalId:  '',
customField: '20100117-160047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5923',
internalId:  '',
customField: '20100809-165736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3101',
internalId:  '',
customField: '20100331-093833'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3812',
internalId:  '',
customField: '20100331-103231'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4212',
internalId:  '',
customField: '20100613-182324'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4412',
internalId:  '',
customField: '20100406-202507'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4723',
internalId:  '',
customField: '20100505-190704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4923',
internalId:  '',
customField: '20100203-193107'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5123',
internalId:  '',
customField: '20100118-180600'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5323',
internalId:  '',
customField: '20100304-201442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5523',
internalId:  '',
customField: '20100203-193238'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5723',
internalId:  '',
customField: '20100602-083252'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN3QSV';
var companyName   = 'Captain+William+Wells';
var htmlTitle	  = 'Captain+William+Wells%2C+Maritime+Speaker+';
var metaKeywords  = 'Admiral%2C+After%2C+Atlantic%2C+Battle%2C+Bermuda%2C+Building%2C+Captain%2C+Corporate%2C+Difference%2C+Dinner%2CExperience%2C+Harbour%2C+History%2C+House%2C+Inspirational%2C+Interesting%2C+Leadership%2C%09Legends%2C+London%2C+Lord%2C+Marine%2C+Mariner%2C+Maritime%2C+Master%2C+Myths%2C+Nautical%2C+Naval%2C+Nautically%2C+Navy%2C+Nelson%2C+Ocean%2C+Passionate%2C+Pilot%2C+Port%2C+Public%2C+Professional%2C+Qualified%2C+Sailor%2C+Sailors%2C+Sea%2C+Seaman%2C+Seamen%2C+Senior%2C+Speaker%2C+Speakers%2C+Speaking%2C+Speech%2C+Trafalgar%2C+Team%2C+Triangle%2C+Trinity%2C+Voice%2C+Voice+Over%2C+Artist%2C+Artiste%2C+Over%2C+Record%2C+Recording%2C+Recorder%2C+Commercial%2C+Adverts%2C+Advertisement%2C+Advertisements%2C+Advert%2C+Presenter%2C+Motivator%2C+Motivational%2C+Motivational%2C+Pilots%2C+Pilotage%2C+Piloting%2C+Radio%2C+Station%2C+cruiseship+speakers%2C+cruise+ship+speakers%2C+cruiseship+speaker%2C+cruise+ship+speakers%2C';
var metaContents  = 'Informative%2C+entertaining+speaker+for+all+occasions+as+well+as+speaking+on+board+cruise+ships.';
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();
};
