/* [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','254',jdecode('Home'),jdecode(''), jdecode('%2F254.html'), 'true',[],'',''],
	['PAGE','275',jdecode('About+IPMA-HR'),jdecode(''), jdecode('%2F275.html'), 'true',[],'',''],
	['PAGE','38656',jdecode('IMPA-HR+CCC+Elections'),jdecode(''), jdecode('%2F38656.html'), 'true',[],'',''],
	['PAGE','284',jdecode('Conferences+%26+Events'),jdecode(''), jdecode('%2F284%2Findex.html'), 'true',[ 
		['PAGE','3929',jdecode('2006+Photos'),jdecode(''), jdecode('%2F284%2F3929.html'), 'true',[],'',''],
		['PAGE','32956',jdecode('2009+Conference'),jdecode(''), jdecode('%2F284%2F32956.html'), 'false',[],'','']
	],'',''],
	['PAGE','293',jdecode('Board+Members'),jdecode(''), jdecode('%2F293.html'), 'true',[],'',''],
	['PAGE','3817',jdecode('Job+Board'),jdecode(''), jdecode('%2F3817.html'), 'true',[],'',''],
	['PAGE','302',jdecode('Contact'),jdecode(''), jdecode('%2F302%2Findex.html'), 'true',[ 
		['PAGE','1772',jdecode('Contact+%28follow+up+page%29'),jdecode(''), jdecode('%2F302%2F1772.html'), 'false',[],'','']
	],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='NewYork';
theSitetree.paletteFamily='FFCC33';
theSitetree.keyvisualId='924';
theSitetree.keyvisualName='studenten.jpg';
theSitetree.fontsetId='168';
theSitetree.graphicsetId='199';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'westhost',
  product: 'WSCSYSSSSLYTC2VW'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'NewYork',
				paletteFamily: 	'FFCC33',
				keyvisualId: 	'924',
				keyvisualName: 	'studenten.jpg',
				fontsetId: 		'168',
				graphicsetId: 	'199',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000066',
				b_color: 		'FFCC33',
				c_color: 		'000000',
				d_color: 		'406BC0',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '38656',
internalId:  '-',
customField: '20120201-143445'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '254',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '254',
internalId:  '',
customField: '20090115-115419'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '275',
internalId:  '',
customField: '20101115-110821'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '284',
internalId:  '',
customField: '20111215-134113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '293',
internalId:  '',
customField: '20110606-172019'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3817',
internalId:  '',
customField: '20070712-164229'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '302',
internalId:  '',
customField: '20060926-091136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3929',
internalId:  '',
customField: '20061002-180242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1772',
internalId:  '',
customField: '20060731-112902'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32956',
internalId:  '',
customField: '20090511-145444'
};
webappMappings['7008']=webappMappings['7008-633']={
webappId:    '7008',
documentId:  '302',
internalId:  '633',
customField: 'language:en;country:US;'
};
var webAppHostname = 'cgicm4all.west-datacenter.net:80';
var canonHostname = 'cm4all01.west-datacenter.net';
var accountId     = 'AWH010IN2CT4';
var companyName   = 'IPMA-HR+Central+California+Chapter';
var htmlTitle	  = 'IPMA-HR+Central+California+Chapter';
var metaKeywords  = 'Human+Resources%2C+California%2C+networking%2C+public+sector+human+resources%2C+HR+leadership+strategies%2C+HR%2C+California+Human+Resources%2C+International+Public+Management+Association%2C+';
var metaContents  = 'Central+California+Chapter+of+IPMA-HR+is+part+of+the+Western+Region+of+IPMA-HR.+We+are+focused+on+Human+Resources+management%2C+networking%2C+leadership%2C+executive+strategies+for+public+sector+employers.+';
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();
};

