/* [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','7001',jdecode('About+us'),jdecode(''),'/7001/index.html','true',[ 
		['PAGE','7022',jdecode('The+Team'),jdecode(''),'/7001/7022.html','true',[],'',''],
		['PAGE','7043',jdecode('Kirikiriroa+Marae'),jdecode(''),'/7001/7043.html','true',[],'',''],
		['PAGE','7064',jdecode('Working+Together'),jdecode(''),'/7001/7064.html','true',[],'',''],
		['PAGE','8364',jdecode('Tainui+Relationship+'),jdecode(''),'/7001/8364.html','true',[],'',''],
		['PAGE','8301',jdecode('Community+Links'),jdecode(''),'/7001/8301.html','true',[],'',''],
		['PAGE','8322',jdecode('Accreditation'),jdecode(''),'/7001/8322.html','true',[],'',''],
		['PAGE','8343',jdecode('Funders'),jdecode(''),'/7001/8343.html','true',[],'','']
	],'',''],
	['PAGE','8385',jdecode('Duty'),jdecode(''),'/8385/index.html','true',[ 
		['PAGE','8406',jdecode('Health'),jdecode(''),'/8385/8406.html','true',[],'',''],
		['PAGE','8427',jdecode('Social'),jdecode(''),'/8385/8427.html','true',[],'','']
	],'',''],
	['PAGE','64801',jdecode('Services'),jdecode(''),'/64801/index.html','true',[ 
		['PAGE','64822',jdecode('Clinic'),jdecode(''),'/64801/64822.html','true',[],'',''],
		['PAGE','64843',jdecode('Auahi+Kore'),jdecode(''),'/64801/64843.html','true',[],'',''],
		['PAGE','64864',jdecode('Cardiac+%26+Stroke+Rehab'),jdecode(''),'/64801/64864.html','true',[],'',''],
		['PAGE','64885',jdecode('Child+Nurse+Coordinator'),jdecode(''),'/64801/64885.html','true',[],'',''],
		['PAGE','64906',jdecode('Disability+Services'),jdecode(''),'/64801/64906.html','true',[],'',''],
		['PAGE','64927',jdecode('Disease+State+Management'),jdecode(''),'/64801/64927.html','true',[],'',''],
		['PAGE','64948',jdecode('Hearing+%26+Nutrition'),jdecode(''),'/64801/64948.html','true',[],'',''],
		['PAGE','64969',jdecode('Kaumatua+Programme'),jdecode(''),'/64801/64969.html','true',[],'',''],
		['PAGE','64990',jdecode('Lomilomi'),jdecode(''),'/64801/64990.html','true',[],'',''],
		['PAGE','65011',jdecode('Outreach+Immunisations'),jdecode(''),'/64801/65011.html','true',[],'',''],
		['PAGE','65032',jdecode('Project+Energize'),jdecode(''),'/64801/65032.html','true',[],'',''],
		['PAGE','65053',jdecode('Smoking+Cessation'),jdecode(''),'/64801/65053.html','true',[],'',''],
		['PAGE','65074',jdecode('Strengthening+Families'),jdecode(''),'/64801/65074.html','true',[],'',''],
		['PAGE','65095',jdecode('Tamariki+Ora'),jdecode(''),'/64801/65095.html','true',[],'',''],
		['PAGE','65116',jdecode('Tu+Kaha'),jdecode(''),'/64801/65116.html','true',[],'',''],
		['PAGE','65137',jdecode('Tu+Maia'),jdecode(''),'/64801/65137.html','true',[],'',''],
		['PAGE','65158',jdecode('Whanau+Ora'),jdecode(''),'/64801/65158.html','true',[],'','']
	],'',''],
	['PAGE','494',jdecode('Current+Events'),jdecode(''),'/494/index.html','true',[ 
		['PAGE','16501',jdecode('Fundrasing+Campaign'),jdecode(''),'/494/16501.html','true',[],'',''],
		['PAGE','39701',jdecode('Events+Calendar'),jdecode(''),'/494/39701.html','true',[],'','']
	],'',''],
	['PAGE','515',jdecode('Jobs'),jdecode(''),'/515.html','true',[],'',''],
	['PAGE','536',jdecode('Contact+Us'),jdecode(''),'/536/index.html','true',[ 
		['PAGE','557',jdecode('Addresses'),jdecode(''),'/536/557.html','true',[],'',''],
		['PAGE','578',jdecode('How+to+find+us'),jdecode(''),'/536/578.html','true',[],'','']
	],'',''],
	['PAGE','42201',jdecode('Glossary'),jdecode(''),'/42201.html','true',[],'',''],
	['PAGE','57106',jdecode('Guestbook'),jdecode(''),'/57106/index.html','true',[ 
		['PAGE','57101',jdecode('Read+Guestbook'),jdecode(''),'/57106/57101.html','false',[],'','']
	],'','']];
var siteelementCount=40;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='AC2323';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='290';
theSitetree.graphicsetId='356';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='AC2323';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'AC2323',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'290',
				graphicsetId: 	'356',
				contentColor: 	'FFFFFF',
				contentBGColor: 'AC2323',
				a_color: 		'AC2323',
				b_color: 		'480F0F',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7022',
internalId:  '',
customField: '20071220-174306'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7001',
internalId:  '',
customField: '20071105-185723'
};
webappMappings['1002']=webappMappings['1002-57106avec10inln50']={
webappId:    '1002',
documentId:  '57106',
internalId:  '57106avec10inln50',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20081030-195237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7043',
internalId:  '',
customField: '20070823-201516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7064',
internalId:  '',
customField: '20070909-150729'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8364',
internalId:  '',
customField: '20070909-145430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8301',
internalId:  '',
customField: '20071105-185521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8322',
internalId:  '',
customField: '20070812-204447'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8343',
internalId:  '',
customField: '20070823-193355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8385',
internalId:  '',
customField: '20070823-201223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8406',
internalId:  '',
customField: '20070823-170635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8427',
internalId:  '',
customField: '20070820-193531'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20081030-205701'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16501',
internalId:  '',
customField: '20070904-202606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39701',
internalId:  '',
customField: '20081120-163050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20081120-163447'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '536',
internalId:  '',
customField: '20081006-163730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '557',
internalId:  '',
customField: '20070823-200524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '578',
internalId:  '',
customField: '20070816-194127'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42201',
internalId:  '',
customField: '20081102-212553'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57106',
internalId:  '',
customField: '20081006-160328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57101',
internalId:  '',
customField: '20081006-160328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64801',
internalId:  '',
customField: '20090823-222705'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64822',
internalId:  '',
customField: '20090823-232258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64843',
internalId:  '',
customField: '20090824-165340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64864',
internalId:  '',
customField: '20090824-172607'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64885',
internalId:  '',
customField: '20090826-223732'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64906',
internalId:  '',
customField: '20090826-224425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64927',
internalId:  '',
customField: '20090824-181832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64948',
internalId:  '',
customField: '20090824-222045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64969',
internalId:  '',
customField: '20090824-223742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64990',
internalId:  '',
customField: '20090825-192436'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65011',
internalId:  '',
customField: '20090825-183343'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65032',
internalId:  '',
customField: '20090825-215935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65053',
internalId:  '',
customField: '20090824-225442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65074',
internalId:  '',
customField: '20090825-225141'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65095',
internalId:  '',
customField: '20090810-172406'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65116',
internalId:  '',
customField: '20090825-231543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65137',
internalId:  '',
customField: '20090825-234619'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65158',
internalId:  '',
customField: '20090825-181617'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INLN50';
var companyName   = 'Te+Kohao+Health+Ltd';
var htmlTitle	  = 'Te+Kohao+Health+Ltd';
var metaKeywords  = 'Medical+Centre++General+Practice++Tamariki+Ora++Well+Child++Immunisation+Outreach++Cardiovascular+Rehabilitation+++Auahi+Kore++Smoking+Cessation++Nutrition++injury+Prevention++Hearing+++Immunisation++Kaumatua++Kuia+Service++Project+Energize++DSL+Assessors++ACC+Social+Rehabilitation+Assessors++ACC+Community+Home+Based+Nursing++Maori+Disability+Service++Home+Based+Support+Service++ACC+Home+based+Rehabilitation+Services++Social+Services++Strengthening+families++Youth+Justice+Assessors%2C+Vacancies%2C+Fundraising%2C+Maori';
var metaContents  = 'Maori+Health+Provider++Primary+Health+Care++Job+Vacancies%2C+Fundraising';
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();
};
