/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','81612',jdecode('2010+Dist.+52+11-12+All+Stars'),jdecode(''),'/81612/index.html','true',[ 
		['PAGE','84612',jdecode('Field+location+%2F+directions'),jdecode(''),'/81612/84612.html','true',[],'',''],
		['PAGE','84633',jdecode('Snack+Shack'),jdecode(''),'/81612/84633.html','true',[],'',''],
		['PAGE','85012',jdecode('Accommodations'),jdecode(''),'/81612/85012.html','true',[],'',''],
		['PAGE','85612',jdecode('All+Star+Sponsors'),jdecode(''),'/81612/85612.html','true',[],'',''],
		['PAGE','85633',jdecode('Photography'),jdecode(''),'/81612/85633.html','true',[],'','']
	],'',''],
	['PAGE','10822',jdecode('Calendar'),jdecode(''),'/10822.html','true',[],'',''],
	['PAGE','9243',jdecode('Coaches+and+Teams'),jdecode(''),'/9243.html','true',[],'',''],
	['PAGE','4864',jdecode('Contact+Information'),jdecode(''),'/4864.html','true',[],'',''],
	['PAGE','40001',jdecode('2010+Pitching+Rules'),jdecode(''),'/40001.html','true',[],'',''],
	['PAGE','9285',jdecode('Field+Locations'),jdecode(''),'/9285.html','true',[],'',''],
	['PAGE','9264',jdecode('Forms'),jdecode(''),'/9264.html','true',[],'',''],
	['PAGE','83712',jdecode('Fundraising'),jdecode(''),'/83712.html','true',[],'',''],
	['PAGE','4801',jdecode('League+Information'),jdecode(''),'/4801.html','true',[],'',''],
	['PAGE','10301',jdecode('Links'),jdecode(''),'/10301.html','true',[],'',''],
	['PAGE','4843',jdecode('News'),jdecode(''),'/4843.html','true',[],'',''],
	['PAGE','22301',jdecode('Rules+and+Procedures'),jdecode(''),'/22301.html','true',[],'',''],
	['PAGE','10801',jdecode('Schedules'),jdecode(''),'/10801.html','true',[],'',''],
	['PAGE','9222',jdecode('Sponsors'),jdecode(''),'/9222.html','true',[],'',''],
	['PAGE','19801',jdecode('Training+and+Resources'),jdecode(''),'/19801.html','true',[],'',''],
	['PAGE','10322',jdecode('Photo+Gallery'),jdecode(''),'/10322.html','true',[],'',''],
	['PAGE','19206',jdecode('Guestbook'),jdecode(''),'/19206/index.html','true',[ 
		['PAGE','19201',jdecode('Read+Guestbook'),jdecode(''),'/19206/19201.html','false',[],'','']
	],'','']];
var siteelementCount=24;
theSitetree.topTemplateName='Easylife';
theSitetree.paletteFamily='2962B0';
theSitetree.keyvisualId='5825';
theSitetree.keyvisualName='kv_5825.jpg';
theSitetree.fontsetId='11095';
theSitetree.graphicsetId='11871';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Easylife',
				paletteFamily: 	'2962B0',
				keyvisualId: 	'5825',
				keyvisualName: 	'kv_5825.jpg',
				fontsetId: 		'11095',
				graphicsetId: 	'11871',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-2436068']={
webappId:    '1501',
documentId:  '401',
internalId:  '2436068',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-19206ahw050invne9']={
webappId:    '1002',
documentId:  '19206',
internalId:  '19206ahw050invne9',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20100707-015728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4843',
internalId:  '',
customField: '20100430-160535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4801',
internalId:  '',
customField: '20100206-223824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4864',
internalId:  '',
customField: '20100326-162359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9222',
internalId:  '',
customField: '20100526-220632'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9243',
internalId:  '',
customField: '20100210-213015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22301',
internalId:  '',
customField: '20100206-224007'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10801',
internalId:  '',
customField: '20100414-225909'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9264',
internalId:  '',
customField: '20100216-162436'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9285',
internalId:  '',
customField: '20100206-224646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10301',
internalId:  '',
customField: '20081006-131623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10822',
internalId:  '',
customField: '20100224-004331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10322',
internalId:  '',
customField: '20100206-224915'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19206',
internalId:  '',
customField: '20080921-154156'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19201',
internalId:  '',
customField: '20080921-154156'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19801',
internalId:  '',
customField: '20100117-120815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40001',
internalId:  '',
customField: '20100117-115216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81612',
internalId:  '',
customField: '20100628-141626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84612',
internalId:  '',
customField: '20100622-145721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83712',
internalId:  '',
customField: '20100621-204233'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84633',
internalId:  '',
customField: '20100622-150019'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85012',
internalId:  '',
customField: '20100622-150956'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85612',
internalId:  '',
customField: '20100625-224512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85633',
internalId:  '',
customField: '20100628-164315'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INVNE9';
var companyName   = 'Pacifica+American+Little+League';
var htmlTitle	  = '';
var metaKeywords  = 'little+league%3B+pacifica%3B+PALL%3B+';
var metaContents  = 'baseball%3B+pacifica+baseball%3B+baseball+camps%3B+';
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();
};
