/* [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','1601',jdecode('Home'),jdecode(''),'/1601.html','true',[],''],
	['PAGE','1932',jdecode('About+us'),jdecode(''),'/1932/index.html','true',[ 
		['PAGE','1953',jdecode('Exec.+Director%2FFounder'),jdecode(''),'/1932/1953.html','true',[],'']
	],''],
	['PAGE','1806',jdecode('Calendar'),jdecode(''),'/1806.html','true',[],''],
	['PAGE','4511',jdecode('Latest+news'),jdecode(''),'/4511.html','true',[],''],
	['PAGE','9801',jdecode('Youth+Programs'),jdecode(''),'/9801/index.html','true',[ 
		['PAGE','9822',jdecode('After+School+Program'),jdecode(''),'/9801/9822.html','true',[],''],
		['PAGE','9843',jdecode('Burch+Summer+Camp'),jdecode(''),'/9801/9843.html','true',[],''],
		['PAGE','9864',jdecode('Martial+Arts'),jdecode(''),'/9801/9864.html','true',[],''],
		['PAGE','21201',jdecode('Dance'),jdecode(''),'/9801/21201.html','true',[],''],
		['PAGE','45301',jdecode('Kids+Algebra'),jdecode(''),'/9801/45301.html','true',[],''],
		['PAGE','21601',jdecode('Arts+and+Crafts'),jdecode(''),'/9801/21601.html','true',[],'']
	],''],
	['PAGE','4532',jdecode('Adult+Literacy%2FGED+'),jdecode(''),'/4532/index.html','true',[ 
		['PAGE','1785',jdecode('Adult+Literacy%2FGED+Classes'),jdecode(''),'/4532/1785.html','true',[],''],
		['PAGE','1722',jdecode('GED+Exam+Classes'),jdecode(''),'/4532/1722.html','true',[],'']
	],''],
	['PAGE','1911',jdecode('Contact'),jdecode(''),'/1911/index.html','true',[ 
		['PAGE','19601',jdecode('Map'),jdecode(''),'/1911/19601.html','true',[],'']
	],''],
	['PAGE','19701',jdecode('Driving+directions'),jdecode(''),'/19701.html','true',[],''],
	['PAGE','10806',jdecode('Guestbook'),jdecode(''),'/10806/index.html','true',[ 
		['PAGE','10801',jdecode('Read+Guestbook'),jdecode(''),'/10806/10801.html','false',[],'']
	],''],
	['PAGE','2037',jdecode('Donations'),jdecode(''),'/2037.html','true',[],''],
	['PAGE','37101',jdecode('Welcome'),jdecode(''),'/37101.html','true',[],''],
	['PAGE','46301',jdecode('2006+Photos'),jdecode(''),'/46301.html','true',[],''],
	['PAGE','51401',jdecode('2007+Photos'),jdecode(''),'/51401.html','true',[],'']];
var siteelementCount=24;
theSitetree.topTemplateName='Kingston';
theSitetree.paletteFamily='7F0B0B';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='11146';
theSitetree.graphicsetId='11952';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='EFD066';
var theTemplate={
				name: 			'Kingston',
				paletteFamily: 	'7F0B0B',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'11146',
				graphicsetId: 	'11952',
				contentColor: 	'000000',
				contentBGColor: 'EFD066',
				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: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC245']={
webappId:    '5003',
documentId:  '1601',
internalId:  'tid:1;pid:WSCSYSSSSLYTC245',
customField: 'en:US:'
};
webappMappings['1501']=webappMappings['1501-1413929']={
webappId:    '1501',
documentId:  '1601',
internalId:  '1413929',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1601',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-10806ahw050inxspf']={
webappId:    '1002',
documentId:  '10806',
internalId:  '10806ahw050inxspf',
customField: 'icq=false'
};
webappMappings['7060']=webappMappings['7060-6ee86df465d1c91dd179790404ef691b']={
webappId:    '7060',
documentId:  '46301',
internalId:  '6ee86df465d1c91dd179790404ef691b',
customField: 'language:en;country:US;'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '19601',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '19701',
internalId:  'routing',
customField: 'en_US'
};
webappMappings['7060']=webappMappings['7060-02e19dea4537dcaa9512f6f934d867e5']={
webappId:    '7060',
documentId:  '37101',
internalId:  '02e19dea4537dcaa9512f6f934d867e5',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-a41090399cbe69d161f3d182d205a30a']={
webappId:    '7060',
documentId:  '46301',
internalId:  'a41090399cbe69d161f3d182d205a30a',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1601',
internalId:  '',
customField: '20081126-101030'
};
webappMappings['7060']=webappMappings['7060-1fc8ba16c9148b4c8ac77694bbbe447d']={
webappId:    '7060',
documentId:  '51401',
internalId:  '1fc8ba16c9148b4c8ac77694bbbe447d',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-569e3a67ae2beefa8b2880b9e6e00889']={
webappId:    '7060',
documentId:  '51401',
internalId:  '569e3a67ae2beefa8b2880b9e6e00889',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-da853999ea1f9b4e281c80802e2f878f']={
webappId:    '7060',
documentId:  '51401',
internalId:  'da853999ea1f9b4e281c80802e2f878f',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4532',
internalId:  '',
customField: '20081125-190140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1785',
internalId:  '',
customField: '20081125-190238'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1932',
internalId:  '',
customField: '20081126-102010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1953',
internalId:  '',
customField: '20080923-183759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1806',
internalId:  '',
customField: '20080903-112515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4511',
internalId:  '',
customField: '20080724-180013'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9801',
internalId:  '',
customField: '20080903-114735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9822',
internalId:  '',
customField: '20080903-075426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9843',
internalId:  '',
customField: '20080723-223639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9864',
internalId:  '',
customField: '20080923-172458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21201',
internalId:  '',
customField: '20080903-144043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45301',
internalId:  '',
customField: '20081001-175440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21601',
internalId:  '',
customField: '20080902-155953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1722',
internalId:  '',
customField: '20080903-143133'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1911',
internalId:  '',
customField: '20080710-172456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19601',
internalId:  '',
customField: '20080714-161247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19701',
internalId:  '',
customField: '20080714-161544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10806',
internalId:  '',
customField: '20080710-170010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10801',
internalId:  '',
customField: '20080710-170010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2037',
internalId:  '',
customField: '20080903-093344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37101',
internalId:  '',
customField: '20080903-113151'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46301',
internalId:  '',
customField: '20080902-213322'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51401',
internalId:  '',
customField: '20080903-000248'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INXSPF';
var companyName   = 'Baychester+Youth+Council%2C+Inc.';
var htmlTitle	  = 'Baychester+Youth+Council%2C+Inc.';
var metaKeywords  = 'Baychester+Youth+Council%2C+karate+training%2C+dance+instruction%2C+basketball%2C+youth%2C+after+school+programs%2C+academic+counseling%2C+Bronx%2C+Edenwald+area%2C+GED+exam+prep%2C+Adult+Literacy';
var metaContents  = 'GED+exam+prep%2C+after+school+academic+programs%2C+computer+training%2C+Adult+Literacy+daytime+and+evening+classes%2C+basketball%2C+dance+and+martial+arts+programs+in+the+Bronx%2C+chess%2C+arts+and+crafts+for+children+and+youth+++';
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();
};

