/* [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','14001',jdecode('HOME'),jdecode(''),'/14001.html','true',[],''],
	['PAGE','17201',jdecode('PHOTOS'),jdecode(''),'/17201/index.html','true',[ 
		['PAGE','57501',jdecode('7-9+years+olds'),jdecode(''),'/17201/57501.html','true',[],''],
		['PAGE','17222',jdecode('10-13+year+olds'),jdecode(''),'/17201/17222.html','true',[],''],
		['PAGE','17264',jdecode('14-17+year+olds'),jdecode(''),'/17201/17264.html','true',[],''],
		['PAGE','91612',jdecode('More+Photos....'),jdecode(''),'/17201/91612.html','true',[],''],
		['PAGE','85812',jdecode('Family+Photos+2009'),jdecode(''),'/17201/85812.html','true',[],'']
	],''],
	['PAGE','17285',jdecode('HISTORY'),jdecode(''),'/17285.html','true',[],''],
	['PAGE','17306',jdecode('MY+TEAM%28STAFF%29'),jdecode(''),'/17306/index.html','true',[ 
		['PAGE','44901',jdecode('Bio+Of+Boy+Staff%26%23x27%3Bs'),jdecode(''),'/17306/44901.html','true',[],''],
		['PAGE','47101',jdecode('Bio+Of+Girl+Staff%26%23x27%3Bs'),jdecode(''),'/17306/47101.html','true',[],'']
	],''],
	['PAGE','17327',jdecode('GUESTBOOK'),jdecode(''),'/17327.html','true',[],''],
	['PAGE','17348',jdecode('ASK+TAY+FISHER...'),jdecode(''),'/17348.html','true',[],''],
	['PAGE','22701',jdecode('UPCOMING+EVENTS'),jdecode(''),'/22701.html','true',[],''],
	['PAGE','60412',jdecode('REGISTRATION+FORMS'),jdecode(''),'/60412.html','true',[],''],
	['PAGE','62812',jdecode('%23+OF+SPOTS+AVAILABLE+'),jdecode(''),'/62812.html','true',[],''],
	['PAGE','77212',jdecode('CAMPERS+IN+COLLEGE'),jdecode(''),'/77212.html','true',[],''],
	['PAGE','44922',jdecode('CONTACT+US'),jdecode(''),'/44922.html','true',[],'']];
var siteelementCount=18;
theSitetree.topTemplateName='Metal';
theSitetree.paletteFamily='64896D';
theSitetree.keyvisualId='787';
theSitetree.keyvisualName='basketball.jpg';
theSitetree.fontsetId='142';
theSitetree.graphicsetId='157';
theSitetree.contentColor='DDDDDD';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Metal',
				paletteFamily: 	'64896D',
				keyvisualId: 	'787',
				keyvisualName: 	'basketball.jpg',
				fontsetId: 		'142',
				graphicsetId: 	'157',
				contentColor: 	'DDDDDD',
				contentBGColor: '000000',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'64896D',
				b_color: 		'A7E4B6',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14001',
internalId:  '',
customField: '20090914-190857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17201',
internalId:  '',
customField: '20090815-193950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17306',
internalId:  '',
customField: '20090816-232041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17222',
internalId:  '',
customField: '20090823-133024'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22701',
internalId:  '',
customField: '20100725-130210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17348',
internalId:  '',
customField: '20090805-190247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17285',
internalId:  '',
customField: '20090813-122106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17327',
internalId:  '',
customField: '20100309-135405'
};
webappMappings['1002']=webappMappings['1002-17327aendu0ine4lq']={
webappId:    '1002',
documentId:  '17327',
internalId:  '17327aendu0ine4lq',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17264',
internalId:  '',
customField: '20090823-134545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44901',
internalId:  '',
customField: '20090827-001323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47101',
internalId:  '',
customField: '20090827-001528'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44922',
internalId:  '',
customField: '20090905-115611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60412',
internalId:  '',
customField: '20090813-022116'
};
webappMappings['1501']=webappMappings['1501-14345265']={
webappId:    '1501',
documentId:  '14001',
internalId:  '14345265',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57501',
internalId:  '',
customField: '20090823-133944'
};
webappMappings['7008']=webappMappings['7008-12391']={
webappId:    '7008',
documentId:  '60412',
internalId:  '12391',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62812',
internalId:  '',
customField: '20100725-130536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77212',
internalId:  '',
customField: '20100724-004943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85812',
internalId:  '',
customField: '20091028-202738'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91612',
internalId:  '',
customField: '20090824-181810'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INE4LQ';
var companyName   = 'TAY+FISHER';
var htmlTitle	  = '';
var metaKeywords  = 'Tay+Fisher+Basketball+Camp%2C+Tay+Fisher%2C+Kingston+Basketball%2C+Kingston+High+School+Basketball%2C+Siena+College+Basketball%2C+Basketball+Camps+Kingston%2C+Basketball+Fundamentals%2C+Fundamentals%2C+Shooting%2C+Dribbling%2C+Defense%2C+Anaconda+Sports%2C+Siena+Saints%2C+Passing%2C+Fun';
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();
};
