/* [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','9114',jdecode('Home'),jdecode(''),'/9114.html','true',[],'',''],
	['PAGE','13501',jdecode('News'),jdecode(''),'/13501/index.html','true',[ 
		['PAGE','13522',jdecode('Calendar+of+Events'),jdecode(''),'/13501/13522.html','true',[],'',''],
		['PAGE','13543',jdecode('Club+Newspaper'),jdecode(''),'/13501/13543.html','true',[],'',''],
		['PAGE','13564',jdecode('Ranking'),jdecode(''),'/13501/13564.html','true',[],'','']
	],'',''],
	['PAGE','13585',jdecode('Team'),jdecode(''),'/13585/index.html','true',[ 
		['PAGE','13606',jdecode('Youth'),jdecode(''),'/13585/13606.html','true',[],'',''],
		['PAGE','13627',jdecode('Women'),jdecode(''),'/13585/13627.html','true',[],'',''],
		['PAGE','13648',jdecode('Men'),jdecode(''),'/13585/13648.html','true',[],'',''],
		['PAGE','13669',jdecode('Senior+Citizens'),jdecode(''),'/13585/13669.html','true',[],'','']
	],'',''],
	['PAGE','13690',jdecode('Members'),jdecode(''),'/13690/index.html','true',[ 
		['PAGE','13711',jdecode('Trainer'),jdecode(''),'/13690/13711.html','true',[],'',''],
		['PAGE','13732',jdecode('Board+of+Directors'),jdecode(''),'/13690/13732.html','true',[],'',''],
		['PAGE','13753',jdecode('Place+of+Business'),jdecode(''),'/13690/13753.html','true',[],'','']
	],'',''],
	['PAGE','13774',jdecode('Links'),jdecode(''),'/13774.html','true',[],'',''],
	['PAGE','16801',jdecode('Join'),jdecode(''),'/16801.html','true',[],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Clipping';
theSitetree.paletteFamily='30366D';
theSitetree.keyvisualId='4496';
theSitetree.keyvisualName='kv_4496.jpg';
theSitetree.fontsetId='13621';
theSitetree.graphicsetId='11271';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='30366D';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Clipping',
				paletteFamily: 	'30366D',
				keyvisualId: 	'4496',
				keyvisualName: 	'kv_4496.jpg',
				fontsetId: 		'13621',
				graphicsetId: 	'11271',
				contentColor: 	'FFFFFF',
				contentBGColor: '30366D',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				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:  '9114',
internalId:  '',
customField: '20110629-211031'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC245']={
webappId:    '5003',
documentId:  '9114',
internalId:  'tid:1;pid:WSCSYSSSSLYTC245',
customField: 'en:US::;language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13501',
internalId:  '',
customField: '20110617-125258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13522',
internalId:  '',
customField: '20110617-125258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13543',
internalId:  '',
customField: '20110617-125258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13564',
internalId:  '',
customField: '20110617-125258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13585',
internalId:  '',
customField: '20110617-125258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13606',
internalId:  '',
customField: '20110617-125258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13627',
internalId:  '',
customField: '20110617-125258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13648',
internalId:  '',
customField: '20110617-125258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13669',
internalId:  '',
customField: '20110617-125258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13690',
internalId:  '',
customField: '20110617-125258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13711',
internalId:  '',
customField: '20110617-125258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13732',
internalId:  '',
customField: '20110617-125258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13753',
internalId:  '',
customField: '20110617-125258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13774',
internalId:  '',
customField: '20110629-212014'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16801',
internalId:  '',
customField: '20110629-205415'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INFDBP';
var companyName   = 'East+Moriches+NY';
var htmlTitle	  = 'East+Moriches%2C+New+York';
var metaKeywords  = '';
var metaContents  = '';
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();
};

