/* [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','42',jdecode('Home'),jdecode(''), jdecode('%2F42.html'), 'true',[],'',''],
	['PAGE','13712',jdecode('Coaching+Info'),jdecode(''), jdecode('%2F13712%2Findex.html'), 'true',[ 
		['PAGE','13733',jdecode('Coaching+Tips'),jdecode(''), jdecode('%2F13712%2F13733.html'), 'true',[],'','']
	],'',''],
	['PAGE','518',jdecode('Little+League'),jdecode(''), jdecode('%2F518%2Findex.html'), 'true',[ 
		['PAGE','1312',jdecode('Standings'),jdecode(''), jdecode('%2F518%2F1312.html'), 'true',[],'',''],
		['PAGE','2071',jdecode('Schedule'),jdecode(''), jdecode('%2F518%2F2071.html'), 'true',[],'',''],
		['PAGE','28323',jdecode('Scores'),jdecode(''), jdecode('%2F518%2F28323.html'), 'true',[],'','']
	],'',''],
	['PAGE','509',jdecode('Minor+League'),jdecode(''), jdecode('%2F509%2Findex.html'), 'true',[ 
		['PAGE','2053',jdecode('Schedule'),jdecode(''), jdecode('%2F509%2F2053.html'), 'true',[],'',''],
		['PAGE','2062',jdecode('Standings'),jdecode(''), jdecode('%2F509%2F2062.html'), 'true',[],'','']
	],'',''],
	['PAGE','1294',jdecode('Instructional+League'),jdecode(''), jdecode('%2F1294%2Findex.html'), 'true',[ 
		['PAGE','2098',jdecode('Schedule'),jdecode(''), jdecode('%2F1294%2F2098.html'), 'true',[],'','']
	],'',''],
	['PAGE','1303',jdecode('Tee-Ball'),jdecode(''), jdecode('%2F1303%2Findex.html'), 'true',[ 
		['PAGE','1321',jdecode('Schedule'),jdecode(''), jdecode('%2F1303%2F1321.html'), 'true',[],'','']
	],'',''],
	['PAGE','1285',jdecode('Senior+League'),jdecode(''), jdecode('%2F1285%2Findex.html'), 'true',[ 
		['PAGE','2080',jdecode('Schedule'),jdecode(''), jdecode('%2F1285%2F2080.html'), 'true',[],'',''],
		['PAGE','2089',jdecode('Standings'),jdecode(''), jdecode('%2F1285%2F2089.html'), 'true',[],'','']
	],'',''],
	['PAGE','2648',jdecode('Calendar'),jdecode(''), jdecode('%2F2648.html'), 'true',[],'',''],
	['PAGE','14512',jdecode('Sponsors'),jdecode(''), jdecode('%2F14512%2Findex.html'), 'true',[ 
		['PAGE','17212',jdecode('Become+a+Sponsor'),jdecode(''), jdecode('%2F14512%2F17212.html'), 'true',[],'','']
	],'',''],
	['PAGE','527',jdecode('Executive+Board'),jdecode(''), jdecode('%2F527.html'), 'true',[],'',''],
	['PAGE','17112',jdecode('About+us'),jdecode(''), jdecode('%2F17112.html'), 'true',[],'',''],
	['PAGE','2541',jdecode('Contact+Us'),jdecode(''), jdecode('%2F2541.html'), 'true',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Diamond';
theSitetree.paletteFamily='BFD4ED';
theSitetree.keyvisualId='6213';
theSitetree.keyvisualName='kv_6213.jpg';
theSitetree.fontsetId='11090';
theSitetree.graphicsetId='11865';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='BFD4ED';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'hps_testtown',
  product: 'WSCSYSSSSLYTC245'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Diamond',
				paletteFamily: 	'BFD4ED',
				keyvisualId: 	'6213',
				keyvisualName: 	'kv_6213.jpg',
				fontsetId: 		'11090',
				graphicsetId: 	'11865',
				contentColor: 	'000000',
				contentBGColor: 'BFD4ED',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '42',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-88779']={
webappId:    '1501',
documentId:  '42',
internalId:  '88779',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42',
internalId:  '',
customField: '20110614-234825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2648',
internalId:  '',
customField: '20110309-101959'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1303',
internalId:  '',
customField: '20110309-101256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1321',
internalId:  '',
customField: '20070501-040542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1294',
internalId:  '',
customField: '20110309-100213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2098',
internalId:  '',
customField: '20110510-211702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '509',
internalId:  '',
customField: '20110309-093947'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2053',
internalId:  '',
customField: '20110510-211627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2062',
internalId:  '',
customField: '20110516-205900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '518',
internalId:  '',
customField: '20110509-222916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1312',
internalId:  '',
customField: '20110516-205740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2071',
internalId:  '',
customField: '20110124-155951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1285',
internalId:  '',
customField: '20110510-212509'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2080',
internalId:  '',
customField: '20070601-032918'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2089',
internalId:  '',
customField: '20070601-032654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '527',
internalId:  '',
customField: '20110120-114123'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17112',
internalId:  '',
customField: '20090219-135942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2541',
internalId:  '',
customField: '20070209-024719'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13712',
internalId:  '',
customField: '20090219-004826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13733',
internalId:  '',
customField: '20090219-010210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14512',
internalId:  '',
customField: '20110309-102543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17212',
internalId:  '',
customField: '20090219-140019'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28323',
internalId:  '',
customField: '20110510-210943'
};
webappMappings['7008']=webappMappings['7008-7933']={
webappId:    '7008',
documentId:  '2541',
internalId:  '7933',
customField: 'language:en;country:US;'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INX2AN';
var companyName   = 'North+Arlington+Little+League';
var htmlTitle	  = 'North+Arlington+Little+League';
var metaKeywords  = 'NABA%2C+North+Arlington%2C+Little+League%2C+Baseball%2C+NA+Little+League%2C+NA+Baseball%2C+NA+Recreation%2C+New+Jersey%2C+NJ%2C+New+Jersey+Baseball%2C+NJ+Baseball';
var metaContents  = 'NABA%2C+North+Arlington%2C+Little+League%2C+Baseball%2C+NA+Little+League%2C+NA+Baseball%2C+NA+Recreation%2C+New+Jersey%2C+NJ%2C+New+Jersey+Baseball%2C+NJ+Baseball';
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();
};

