/* [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','5101',jdecode('Home'),jdecode(''),'/5101/index.html','true',[ 
		['PAGE','5152',jdecode('NBL+History'),jdecode(''),'/5101/5152.html','true',[],'','']
	],'',''],
	['PAGE','6101',jdecode('Schools'),jdecode(''),'/6101.html','true',[],'',''],
	['PAGE','18558',jdecode('2011+Spring+Schedules'),jdecode(''),'/18558/index.html','true',[ 
		['PAGE','21158',jdecode('Badminton'),jdecode(''),'/18558/21158.html','true',[],'',''],
		['PAGE','21179',jdecode('Baseball'),jdecode(''),'/18558/21179.html','true',[],'',''],
		['PAGE','21200',jdecode('Boy%26%23x27%3Bs+Golf'),jdecode(''),'/18558/21200.html','true',[],'',''],
		['PAGE','21221',jdecode('Boy%26%23x27%3Bs+Tennis'),jdecode(''),'/18558/21221.html','true',[],'',''],
		['PAGE','19558',jdecode('Softball'),jdecode(''),'/18558/19558.html','true',[],'',''],
		['PAGE','21242',jdecode('Swimming%2FDiving'),jdecode(''),'/18558/21242.html','true',[],'',''],
		['PAGE','21263',jdecode('Track'),jdecode(''),'/18558/21263.html','true',[],'','']
	],'',''],
	['PAGE','6122',jdecode('School+Links'),jdecode(''),'/6122.html','true',[],'',''],
	['PAGE','25358',jdecode('All+League+Badminton'),jdecode(''),'/25358.html','true',[],'',''],
	['PAGE','25458',jdecode('All+League+Baseball'),jdecode(''),'/25458.html','true',[],'',''],
	['PAGE','25479',jdecode('All+League+Basketball'),jdecode(''),'/25479.html','true',[],'',''],
	['PAGE','25500',jdecode('All+League+C.+Country'),jdecode(''),'/25500.html','true',[],'',''],
	['PAGE','25521',jdecode('All+League+Football'),jdecode(''),'/25521.html','true',[],'',''],
	['PAGE','25542',jdecode('All+League+Golf'),jdecode(''),'/25542.html','true',[],'',''],
	['PAGE','25563',jdecode('All+League+Soccer'),jdecode(''),'/25563.html','true',[],'',''],
	['PAGE','25584',jdecode('All+League+Softball'),jdecode(''),'/25584.html','true',[],'',''],
	['PAGE','25605',jdecode('All+League+Swimming'),jdecode(''),'/25605.html','true',[],'',''],
	['PAGE','25626',jdecode('All+League+Tennis'),jdecode(''),'/25626.html','true',[],'',''],
	['PAGE','25647',jdecode('All+League+Track%2FField'),jdecode(''),'/25647.html','true',[],'',''],
	['PAGE','25668',jdecode('All+League+Volleyball'),jdecode(''),'/25668.html','true',[],'',''],
	['PAGE','25689',jdecode('All+League+Wrestling'),jdecode(''),'/25689.html','true',[],'',''],
	['PAGE','6164',jdecode('Post+Season'),jdecode(''),'/6164.html','true',[],'',''],
	['PAGE','6185',jdecode('League+Champions'),jdecode(''),'/6185.html','true',[],'','']];
var siteelementCount=27;
theSitetree.topTemplateName='Architekt';
theSitetree.paletteFamily='90A262';
theSitetree.keyvisualId='1707';
theSitetree.keyvisualName='jogging.jpg';
theSitetree.fontsetId='280';
theSitetree.graphicsetId='344';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='90A262';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Architekt',
				paletteFamily: 	'90A262',
				keyvisualId: 	'1707',
				keyvisualName: 	'jogging.jpg',
				fontsetId: 		'280',
				graphicsetId: 	'344',
				contentColor: 	'000000',
				contentBGColor: '90A262',
				a_color: 		'90A262',
				b_color: 		'525D37',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				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:  '5101',
internalId:  '',
customField: '20091020-125800'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5152',
internalId:  '',
customField: '20091019-125250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6101',
internalId:  '',
customField: '20100629-213945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6122',
internalId:  '',
customField: '20100629-211321'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25358',
internalId:  '',
customField: '20101208-131426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6164',
internalId:  '',
customField: '20100221-181440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6185',
internalId:  '',
customField: '20091019-141046'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18558',
internalId:  '',
customField: '20100830-111151'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19558',
internalId:  '',
customField: '20100628-165030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21158',
internalId:  '',
customField: '20100628-174643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21179',
internalId:  '',
customField: '20100628-181034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21200',
internalId:  '',
customField: '20100628-182700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21221',
internalId:  '',
customField: '20100629-203424'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21242',
internalId:  '',
customField: '20100629-203654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21263',
internalId:  '',
customField: '20100629-203920'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INLV89';
var companyName   = '+++++++++++++++++++++North+Bay+League';
var htmlTitle	  = '';
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();
};

