/* [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','1901',jdecode('AML+Consultants+'),jdecode(''),'/1901.html','true',[],''],
	['PAGE','18912',jdecode('Money+Laundering'),jdecode(''),'/18912.html','true',[],''],
	['PAGE','18933',jdecode('Terrorism+Financing'),jdecode(''),'/18933/index.html','true',[ 
		['PAGE','19175',jdecode('Charities'),jdecode(''),'/18933/19175.html','true',[],''],
		['PAGE','19196',jdecode('Informal+Money+Remitters'),jdecode(''),'/18933/19196.html','true',[],'']
	],''],
	['PAGE','18954',jdecode('Economic+Sanctions'),jdecode(''),'/18954.html','true',[],''],
	['PAGE','2141',jdecode('Risk+Based+Approach'),jdecode(''),'/2141/index.html','true',[ 
		['PAGE','19217',jdecode('Measuring+Risk'),jdecode(''),'/2141/19217.html','true',[],''],
		['PAGE','19238',jdecode('Risk+Matrix'),jdecode(''),'/2141/19238.html','true',[],''],
		['PAGE','19259',jdecode('Risk+Cycle'),jdecode(''),'/2141/19259.html','true',[],'']
	],''],
	['PAGE','1973',jdecode('AML+CFT+Risk+Assessment'),jdecode(''),'/1973/index.html','true',[ 
		['PAGE','4001',jdecode('Business+Risk'),jdecode(''),'/1973/4001.html','true',[],''],
		['PAGE','1994',jdecode('Product+Risk'),jdecode(''),'/1973/1994.html','true',[],''],
		['PAGE','2015',jdecode('Customer+Risk'),jdecode(''),'/1973/2015.html','true',[],''],
		['PAGE','23212',jdecode('Politically+Exposed+Person'),jdecode(''),'/1973/23212.html','true',[],''],
		['PAGE','23233',jdecode('Corporate+Customer'),jdecode(''),'/1973/23233.html','true',[],''],
		['PAGE','2036',jdecode('Geography+Risk'),jdecode(''),'/1973/2036.html','true',[],''],
		['PAGE','2057',jdecode('Delivery+Risk'),jdecode(''),'/1973/2057.html','true',[],'']
	],''],
	['PAGE','2078',jdecode('AML+CFT+Programme'),jdecode(''),'/2078/index.html','true',[ 
		['PAGE','2906',jdecode('Ongoing+Due+Diligence'),jdecode(''),'/2078/2906.html','true',[],''],
		['PAGE','2864',jdecode('Reporting+Suspicious+Transactions'),jdecode(''),'/2078/2864.html','true',[],''],
		['PAGE','2801',jdecode('Staff+Vetting'),jdecode(''),'/2078/2801.html','true',[],''],
		['PAGE','2822',jdecode('Training'),jdecode(''),'/2078/2822.html','true',[],''],
		['PAGE','2885',jdecode('Record+Keeping'),jdecode(''),'/2078/2885.html','true',[],''],
		['PAGE','2948',jdecode('Third+Party+Agents'),jdecode(''),'/2078/2948.html','true',[],''],
		['PAGE','2969',jdecode('Policies+%26+Procedures'),jdecode(''),'/2078/2969.html','true',[],'']
	],''],
	['PAGE','2162',jdecode('Designated+Business+Groups'),jdecode(''),'/2162.html','true',[],''],
	['PAGE','1952',jdecode('About+Us'),jdecode(''),'/1952.html','true',[],'']];
var siteelementCount=28;
theSitetree.topTemplateName='Office';
theSitetree.paletteFamily='727D9C';
theSitetree.keyvisualId='11163';
theSitetree.keyvisualName='kv_11163.jpg';
theSitetree.fontsetId='32062';
theSitetree.graphicsetId='13879';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Office',
				paletteFamily: 	'727D9C',
				keyvisualId: 	'11163',
				keyvisualName: 	'kv_11163.jpg',
				fontsetId: 		'32062',
				graphicsetId: 	'13879',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1901',
internalId:  '',
customField: '20100310-222017'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1952',
internalId:  '',
customField: '20100310-221821'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1973',
internalId:  '',
customField: '20100208-151356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1994',
internalId:  '',
customField: '20100208-151552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2969',
internalId:  '',
customField: '20100119-061312'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2078',
internalId:  '',
customField: '20100119-050848'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18912',
internalId:  '',
customField: '20100227-042835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2015',
internalId:  '',
customField: '20100124-162328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2036',
internalId:  '',
customField: '20100208-152521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2057',
internalId:  '',
customField: '20100208-152623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18954',
internalId:  '',
customField: '20100208-152745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2801',
internalId:  '',
customField: '20100222-044615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2822',
internalId:  '',
customField: '20100121-145137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2141',
internalId:  '',
customField: '20100120-115737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19175',
internalId:  '',
customField: '20100119-020257'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4001',
internalId:  '',
customField: '20100208-151500'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2864',
internalId:  '',
customField: '20100118-194449'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2885',
internalId:  '',
customField: '20100119-055643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2948',
internalId:  '',
customField: '20100119-055934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2162',
internalId:  '',
customField: '20091211-182406'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18933',
internalId:  '',
customField: '20100120-114552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2906',
internalId:  '',
customField: '20100119-053817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19196',
internalId:  '',
customField: '20100120-115016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19217',
internalId:  '',
customField: '20100121-032511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19238',
internalId:  '',
customField: '20100118-164432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19259',
internalId:  '',
customField: '20100121-033803'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23212',
internalId:  '',
customField: '20100119-164837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23233',
internalId:  '',
customField: '20100118-191251'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0INVYU2';
var companyName   = 'Anti-Money+Laundering%2C+New+Zealand';
var htmlTitle	  = 'Anti-Money+Laundering+Consultants+Ltd+-+New+Zealand';
var metaKeywords  = 'anti+money+laundering%2C+anti+money+laundering+nz%2C+anti+money+laundering+training%2C+anti+money+laundering+legislation%2C+anti+money+laundering+legislation%2C+anti+money+laundering+policy%2C+aml+cft%2C+aml%2C+aml+risk+assessments%2C+aml+cft+risk+assessments%2C+aml+compliance+programmes%2C+aml+cft+compliance+programmes%2C+aml+consultants%2C+aml+consultant%2C+aml+new+zealand%2C+aml+cft+act%2C+aml+legislation%2C+anti-money+laundering%2C+kerry+grass%2C';
var metaContents  = 'Anti-money+laundering+consultants+for+developing+or+reviewing+risk+assessments+and+compliance+programmes.++We+also+provide+tailored+training+designed+to+your+specific+AML+CFT+risks.';
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();
};
