/* [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','601',jdecode('Home'),jdecode(''), jdecode('%2F601.html'), 'true',[],'',''],
	['PAGE','841',jdecode('About+the+PEICA'),jdecode(''), jdecode('%2F841%2Findex.html'), 'true',[ 
		['PAGE','7001',jdecode('Structure'),jdecode(''), jdecode('%2F841%2F7001.html'), 'true',[],'',''],
		['PAGE','7022',jdecode('Constitution'),jdecode(''), jdecode('%2F841%2F7022.html'), 'true',[],'',''],
		['PAGE','7043',jdecode('Executive'),jdecode(''), jdecode('%2F841%2F7043.html'), 'true',[],'','']
	],'',''],
	['PAGE','7064',jdecode('PEICA+Chapters'),jdecode(''), jdecode('%2F7064%2Findex.html'), 'true',[ 
		['PAGE','673',jdecode('Counselling+Psychotherapist+'),jdecode(''), jdecode('%2F7064%2F673.html'), 'true',[],'',''],
		['PAGE','694',jdecode('School+Counselling+'),jdecode(''), jdecode('%2F7064%2F694.html'), 'true',[],'','']
	],'',''],
	['PAGE','715',jdecode('Counsellor+Compentencies'),jdecode(''), jdecode('%2F715.html'), 'true',[],'',''],
	['PAGE','6701',jdecode('Ethics'),jdecode(''), jdecode('%2F6701.html'), 'true',[],'',''],
	['PAGE','736',jdecode('Professional+Development'),jdecode(''), jdecode('%2F736.html'), 'true',[],'',''],
	['PAGE','757',jdecode('Position+Papers'),jdecode(''), jdecode('%2F757.html'), 'true',[],'',''],
	['PAGE','778',jdecode('Press+Releases'),jdecode(''), jdecode('%2F778.html'), 'true',[],'',''],
	['PAGE','15643',jdecode('School+Counselling'),jdecode(''), jdecode('%2F15643%2Findex.html'), 'true',[ 
		['PAGE','25701',jdecode('Western+School+Board+'),jdecode(''), jdecode('%2F15643%2F25701.html'), 'true',[],'',''],
		['PAGE','25722',jdecode('Eastern+School+District'),jdecode(''), jdecode('%2F15643%2F25722.html'), 'true',[],'','']
	],'',''],
	['PAGE','820',jdecode('Resources'),jdecode(''), jdecode('%2F820%2Findex.html'), 'true',[ 
		['PAGE','6722',jdecode('Application%3A+New+Chapter'),jdecode(''), jdecode('%2F820%2F6722.html'), 'true',[],'',''],
		['PAGE','15622',jdecode('Psychotherapist'),jdecode(''), jdecode('%2F820%2F15622.html'), 'true',[],'',''],
		['PAGE','44401',jdecode('Application%3A+Membership'),jdecode(''), jdecode('%2F820%2F44401.html'), 'true',[],'','']
	],'',''],
	['PAGE','12101',jdecode('Find+a+Counsellor'),jdecode(''), jdecode('%2F12101.html'), 'true',[],'',''],
	['PAGE','4506',jdecode('Guestbook'),jdecode(''), jdecode('%2F4506%2Findex.html'), 'true',[ 
		['PAGE','4501',jdecode('Read+Guestbook'),jdecode(''), jdecode('%2F4506%2F4501.html'), 'false',[],'','']
	],'',''],
	['PAGE','9701',jdecode('PEICA+Photo%26%23x27%3Bs'),jdecode(''), jdecode('%2F9701.html'), 'true',[],'',''],
	['PAGE','22701',jdecode('PEICA+Links'),jdecode(''), jdecode('%2F22701.html'), 'true',[],'',''],
	['PAGE','25743',jdecode('CCPA+Conference+2012'),jdecode(''), jdecode('%2F25743.html'), 'true',[],'',''],
	['PAGE','37301',jdecode('Lobby+Tools'),jdecode(''), jdecode('%2F37301%2Findex.html'), 'true',[ 
		['PAGE','37901',jdecode('Talking+with+an+MLA'),jdecode(''), jdecode('%2F37301%2F37901.html'), 'true',[],'',''],
		['PAGE','37922',jdecode('Tips+For+MLA+Meeting'),jdecode(''), jdecode('%2F37301%2F37922.html'), 'true',[],'',''],
		['PAGE','37943',jdecode('Letter+to+MLA'),jdecode(''), jdecode('%2F37301%2F37943.html'), 'true',[],'',''],
		['PAGE','37964',jdecode('Sample+Letter+to+the+Hon+Doug+Currie+for+PEI+MLAs'),jdecode(''), jdecode('%2F37301%2F37964.html'), 'true',[],'','']
	],'','']];
var siteelementCount=31;
theSitetree.topTemplateName='Frugality';
theSitetree.paletteFamily='4E5BBA';
theSitetree.keyvisualId='7689';
theSitetree.keyvisualName='kv_7689.jpg';
theSitetree.fontsetId='16748';
theSitetree.graphicsetId='12256';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'brinkster',
  product: 'WSCSYSSSSLYTCVUO'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Frugality',
				paletteFamily: 	'4E5BBA',
				keyvisualId: 	'7689',
				keyvisualName: 	'kv_7689.jpg',
				fontsetId: 		'16748',
				graphicsetId: 	'12256',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '601',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-4506abri10iner5l']={
webappId:    '1002',
documentId:  '4506',
internalId:  '4506abri10iner5l',
customField: 'icq=false'
};
webappMappings['7060']=webappMappings['7060-61c92e7d8132ee8fc3905ffb56aae2a1']={
webappId:    '7060',
documentId:  '9701',
internalId:  '61c92e7d8132ee8fc3905ffb56aae2a1',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20091014-031641'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '841',
internalId:  '',
customField: '20091014-031711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7001',
internalId:  '',
customField: '20070216-120739'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7022',
internalId:  '',
customField: '20091003-111340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7043',
internalId:  '',
customField: '20091004-211856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7064',
internalId:  '',
customField: '20090202-020552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37901',
internalId:  '',
customField: '20090913-230929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '673',
internalId:  '',
customField: '20091004-204533'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '694',
internalId:  '',
customField: '20081128-041935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '715',
internalId:  '',
customField: '20070218-212000'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6701',
internalId:  '',
customField: '20090913-220031'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '736',
internalId:  '',
customField: '20101016-211100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '757',
internalId:  '',
customField: '20070417-204703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '778',
internalId:  '',
customField: '20070218-213450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15643',
internalId:  '',
customField: '20081128-042059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25701',
internalId:  '',
customField: '20101016-220645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25722',
internalId:  '',
customField: '20101016-220612'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '820',
internalId:  '',
customField: '20081020-014139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6722',
internalId:  '',
customField: '20101016-212822'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37301',
internalId:  '',
customField: '20090913-234743'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15622',
internalId:  '',
customField: '20070408-224759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12101',
internalId:  '',
customField: '20101016-220234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4506',
internalId:  '',
customField: '20070215-125056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4501',
internalId:  '',
customField: '20070215-125056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9701',
internalId:  '',
customField: '20070216-153552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22701',
internalId:  '',
customField: '20090914-002345'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25743',
internalId:  '',
customField: '20101016-222608'
};
webappMappings['1501']=webappMappings['1501-12202752']={
webappId:    '1501',
documentId:  '601',
internalId:  '12202752',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44401',
internalId:  '',
customField: '20101016-223120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37922',
internalId:  '',
customField: '20090913-231500'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37943',
internalId:  '',
customField: '20090913-235625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37964',
internalId:  '',
customField: '20090913-232127'
};
var webAppHostname = 'wsc.brinkster.com:80';
var canonHostname = 'wsc1.brinkster.com';
var accountId     = 'ABRI10INER5L';
var companyName   = 'PEICA';
var htmlTitle	  = 'peica';
var metaKeywords  = 'counsellor%2C+counselling%2C+mental+health';
var metaContents  = 'counsellor%2C+counselling%2C+mental+health';
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();
};

