/* [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','6701',jdecode('Home+Welcome'),jdecode(''),'/6701.html','true',[],''],
	['PAGE','35022',jdecode('Registration'),jdecode(''),'/35022.html','true',[],''],
	['PAGE','35043',jdecode('Dates'),jdecode(''),'/35043.html','true',[],''],
	['PAGE','117601',jdecode('News+and+Events'),jdecode(''),'/117601.html','true',[],''],
	['PAGE','35064',jdecode('Sponsors'),jdecode(''),'/35064.html','true',[],''],
	['PAGE','35085',jdecode('Board+Members'),jdecode(''),'/35085.html','true',[],''],
	['PAGE','35001',jdecode('Contact+Us'),jdecode(''),'/35001.html','true',[],''],
	['PAGE','117701',jdecode('Coaches+Corner'),jdecode(''),'/117701.html','true',[],''],
	['PAGE','35106',jdecode('Fields+Maps'),jdecode(''),'/35106.html','true',[],''],
	['PAGE','83769',jdecode('Practice+Schedule'),jdecode(''),'/83769.html','true',[],''],
	['PAGE','83748',jdecode('Standings'),jdecode(''),'/83748.html','true',[],''],
	['PAGE','125401',jdecode('Team'),jdecode(''),'/125401.html','false',[],''],
	['PAGE','83622',jdecode('Division+3'),jdecode(''),'/83622.html','true',[],''],
	['PAGE','83643',jdecode('Division+4'),jdecode(''),'/83643.html','true',[],''],
	['PAGE','83664',jdecode('Division+5'),jdecode(''),'/83664.html','true',[],''],
	['PAGE','83685',jdecode('Division+6'),jdecode(''),'/83685.html','true',[],''],
	['PAGE','83706',jdecode('Division+7'),jdecode(''),'/83706.html','true',[],''],
	['PAGE','83601',jdecode('Picture+Schedule'),jdecode(''),'/83601.html','true',[],''],
	['PAGE','83727',jdecode('Division+6+Boys'),jdecode(''),'/83727.html','false',[],''],
	['PAGE','96601',jdecode('Duties'),jdecode(''),'/96601.html','false',[],'']];
var siteelementCount=20;
theSitetree.topTemplateName='Orbit';
theSitetree.paletteFamily='003366';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='172';
theSitetree.graphicsetId='203';
theSitetree.contentColor='83B6E9';
theSitetree.contentBGColor='003366';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Orbit',
				paletteFamily: 	'003366',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'172',
				graphicsetId: 	'203',
				contentColor: 	'83B6E9',
				contentBGColor: '003366',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'003366',
				b_color: 		'336699',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6701',
internalId:  '',
customField: '20100209-100340'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6701',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-18589341']={
webappId:    '1501',
documentId:  '6701',
internalId:  '18589341',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35085',
internalId:  '',
customField: '20100106-214313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35106',
internalId:  '',
customField: '20100121-200008'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35043',
internalId:  '',
customField: '20100606-142122'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35001',
internalId:  '',
customField: '20091231-191551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35022',
internalId:  '',
customField: '20100607-120133'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35064',
internalId:  '',
customField: '20100606-134627'
};
webappMappings['7080']=webappMappings['7080-694']={
webappId:    '7080',
documentId:  '6701',
internalId:  '694',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83601',
internalId:  '',
customField: '20100607-121056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83685',
internalId:  '',
customField: '20100507-112532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83622',
internalId:  '',
customField: '20100507-111737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83643',
internalId:  '',
customField: '20100607-120929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83664',
internalId:  '',
customField: '20100606-141641'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83706',
internalId:  '',
customField: '20100507-112818'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83727',
internalId:  '',
customField: '20100310-125754'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83748',
internalId:  '',
customField: '20100606-135022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83769',
internalId:  '',
customField: '20100607-121202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '117601',
internalId:  '',
customField: '20100607-120353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '117701',
internalId:  '',
customField: '20100607-120744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96601',
internalId:  '',
customField: '20100106-212817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125401',
internalId:  '',
customField: '20100615-123422'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN24F4';
var companyName   = 'Eastampton+Youth+Soccer+Association';
var htmlTitle	  = 'Eastampton+Youth+Soccer+Association';
var metaKeywords  = 'EYSA';
var metaContents  = 'Eastampton+Youth+Soccer+Association';
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();
};
