/* [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','1901',jdecode('Home'),jdecode(''),'/1901.html','true',[],'',''],
	['PAGE','9301',jdecode('About+Us'),jdecode(''),'/9301.html','true',[],'',''],
	['PAGE','10501',jdecode('Governance'),jdecode(''),'/10501.html','true',[],'',''],
	['PAGE','49681',jdecode('Research+%26+Advocacy+'),jdecode(''),'/49681/index.html','true',[ 
		['PAGE','10943',jdecode('Advocacy+'),jdecode(''),'/49681/10943.html','true',[],'',''],
		['PAGE','50181',jdecode('Research+'),jdecode(''),'/49681/50181.html','true',[],'','']
	],'',''],
	['PAGE','51581',jdecode('Sexy+Female+Condoms%21'),jdecode(''),'/51581.html','true',[],'',''],
	['PAGE','49802',jdecode('Justice+%26+Trauma+Services'),jdecode(''),'/49802/index.html','true',[ 
		['PAGE','50202',jdecode('Access+to+Justice'),jdecode(''),'/49802/50202.html','true',[],'',''],
		['PAGE','50223',jdecode('Trauma+Services'),jdecode(''),'/49802/50223.html','true',[],'','']
	],'',''],
	['PAGE','49781',jdecode('Prevention+%26+Empowerment'),jdecode(''),'/49781/index.html','true',[ 
		['PAGE','50244',jdecode('Community+Mobilisation+'),jdecode(''),'/49781/50244.html','true',[],'',''],
		['PAGE','50265',jdecode('Clinic+Based+Rural+Helpdesks'),jdecode(''),'/49781/50265.html','true',[],'',''],
		['PAGE','50286',jdecode('ZTVA+Programme'),jdecode(''),'/49781/50286.html','true',[],'',''],
		['PAGE','50307',jdecode('HIV+Prevention+%26+Support'),jdecode(''),'/49781/50307.html','true',[],'','']
	],'',''],
	['PAGE','33031',jdecode('Core+Services'),jdecode(''),'/33031/index.html','true',[ 
		['PAGE','11027',jdecode('Finance'),jdecode(''),'/33031/11027.html','true',[],'',''],
		['PAGE','11006',jdecode('M+%26+E+'),jdecode(''),'/33031/11006.html','true',[],'',''],
		['PAGE','16723',jdecode('HR+%26+Administration'),jdecode(''),'/33031/16723.html','true',[],'','']
	],'',''],
	['PAGE','44181',jdecode('Vacancies'),jdecode(''),'/44181.html','true',[],'',''],
	['PAGE','53781',jdecode('Vhembe+Civil+Society+Network'),jdecode(''),'/53781.html','true',[],'',''],
	['PAGE','21431',jdecode('Donors+%26+Partners'),jdecode(''),'/21431.html','true',[],'',''],
	['PAGE','11201',jdecode('Contacting+TVEP'),jdecode(''),'/11201.html','true',[],'',''],
	['PAGE','13723',jdecode('Support+Our+Work%21'),jdecode(''),'/13723.html','true',[],'',''],
	['PAGE','38131',jdecode('Tians+Blog%21'),jdecode(''),'/38131.html','false',[],'',''],
	['PAGE','10901',jdecode('Empowerment+'),jdecode(''),'/10901.html','false',[],'',''],
	['PAGE','10922',jdecode('HIV+%26+Psycho+Social+Support'),jdecode(''),'/10922.html','false',[],'',''],
	['PAGE','10964',jdecode('Access+to+Justice'),jdecode(''),'/10964.html','false',[],'','']];
var siteelementCount=28;
theSitetree.topTemplateName='Grace';
theSitetree.paletteFamily='80B3EC';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='32050';
theSitetree.graphicsetId='13871';
theSitetree.contentColor='5484ba';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Grace',
				paletteFamily: 	'80B3EC',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'32050',
				graphicsetId: 	'13871',
				contentColor: 	'5484ba',
				contentBGColor: 'FFFFFF',
				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: '20100708-165124'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1901',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-412309']={
webappId:    '1501',
documentId:  '1901',
internalId:  '412309',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9301',
internalId:  '',
customField: '20090912-153746'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10501',
internalId:  '',
customField: '20100326-072216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11201',
internalId:  '',
customField: '20090403-085341'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16723',
internalId:  '',
customField: '20100325-165255'
};
webappMappings['7008']=webappMappings['7008-184']={
webappId:    '7008',
documentId:  '13723',
internalId:  '184',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51581',
internalId:  '',
customField: '20100730-121329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50244',
internalId:  '',
customField: '20100325-153644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50202',
internalId:  '',
customField: '20100325-132531'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10901',
internalId:  '',
customField: '20090913-150606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10922',
internalId:  '',
customField: '20090913-145804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10943',
internalId:  '',
customField: '20100327-115515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10964',
internalId:  '',
customField: '20091001-173340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11006',
internalId:  '',
customField: '20100325-163651'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11027',
internalId:  '',
customField: '20100325-163241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13723',
internalId:  '',
customField: '20090403-085819'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33031',
internalId:  '',
customField: '20100325-162624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49802',
internalId:  '',
customField: '20100325-130303'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49781',
internalId:  '',
customField: '20100325-152746'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50265',
internalId:  '',
customField: '20100325-154143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50286',
internalId:  '',
customField: '20100325-154629'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21431',
internalId:  '',
customField: '20100602-131109'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50223',
internalId:  '',
customField: '20100325-134221'
};
webappMappings['7050']=webappMappings['7050-36']={
webappId:    '7050',
documentId:  '38131',
internalId:  '36',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38131',
internalId:  '',
customField: '20091108-101933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44181',
internalId:  '',
customField: '20100513-094955'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49681',
internalId:  '',
customField: '20100325-122313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50307',
internalId:  '',
customField: '20100325-161101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50181',
internalId:  '',
customField: '20100325-115648'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53781',
internalId:  '',
customField: '20100327-084030'
};
var canonHostname = 'sitebuilder1.nur4.host-h.net';
var accountId     = 'AHZGE0INXX9S';
var companyName   = 'Thohoyandou+Victim+Empowerment+Programme';
var htmlTitle	  = 'The+Thohoyandou+Victim+Empowerment+Programme+%28T.V.E.P%29+.+There+is+NO+excuse+for+abuse%21';
var metaKeywords  = 'Victim%2C+Empowerment%2C+Thohoyandou%2C+Sexual+Violence%2C+Assault%2C+Thulamela%2C+Trauma+Centre%2C+PEP%2C+ARVT';
var metaContents  = 'Thohoyandou+Victim+Empowerment+Programme';
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();
};
