/* [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','4701',jdecode('NWBI+HOME'),jdecode(''),'/4701.html','true',[],''],
	['PAGE','5327',jdecode('ABOUT+NWBI+%26+INSTRUCTORS'),jdecode(''),'/5327/index.html','true',[ 
		['PAGE','18601',jdecode('INSTRUCTORS'),jdecode(''),'/5327/18601.html','true',[],'']
	],''],
	['PAGE','31601',jdecode('BATTING+CAGE+RENTALS'),jdecode(''),'/31601.html','true',[],''],
	['PAGE','5306',jdecode('BASEBALL+CAMPS+%2F+CLINICS'),jdecode(''),'/5306/index.html','true',[ 
		['PAGE','21001',jdecode('Spring+Break+Camp'),jdecode(''),'/5306/21001.html','true',[],''],
		['PAGE','21022',jdecode('Summer+Camp'),jdecode(''),'/5306/21022.html','true',[],''],
		['PAGE','33601',jdecode('HITTING+CLINIC'),jdecode(''),'/5306/33601.html','true',[],''],
		['PAGE','33622',jdecode('PITCHING+CLINIC'),jdecode(''),'/5306/33622.html','true',[],''],
		['PAGE','33643',jdecode('FIELDING+CLINIC'),jdecode(''),'/5306/33643.html','true',[],'']
	],''],
	['PAGE','26401',jdecode('BASEBALL+LINKS'),jdecode(''),'/26401.html','true',[],''],
	['PAGE','21043',jdecode('FALL+BALL'),jdecode(''),'/21043.html','true',[],''],
	['PAGE','5201',jdecode('SMALL+GROUP+INSTRUCTION'),jdecode(''),'/5201/index.html','true',[ 
		['PAGE','20901',jdecode('Private+Instruction'),jdecode(''),'/5201/20901.html','true',[],''],
		['PAGE','20922',jdecode('Small+Group+Hitting'),jdecode(''),'/5201/20922.html','true',[],''],
		['PAGE','22601',jdecode('Small+Group+Pitching'),jdecode(''),'/5201/22601.html','true',[],'']
	],''],
	['PAGE','5264',jdecode('CATCHING+CLASSES'),jdecode(''),'/5264.html','true',[],''],
	['PAGE','5285',jdecode('FIELDING+CLASSES'),jdecode(''),'/5285.html','true',[],''],
	['PAGE','5222',jdecode('HITTING+CLASSES'),jdecode(''),'/5222.html','true',[],''],
	['PAGE','5243',jdecode('PITCHING+CLASSES'),jdecode(''),'/5243.html','true',[],''],
	['PAGE','5501',jdecode('ONLINE+STORE'),jdecode(''),'/5501.html','true',[],''],
	['PAGE','5348',jdecode('CONTACT+US'),jdecode(''),'/5348.html','true',[],'']];
var siteelementCount=22;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='294';
theSitetree.graphicsetId='355';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333F65';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'294',
				graphicsetId: 	'355',
				contentColor: 	'FFFFFF',
				contentBGColor: '333F65',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'333F65',
				b_color: 		'040507',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4701',
internalId:  '',
customField: '20091229-222544'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20091229-214203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5222',
internalId:  '',
customField: '20091229-185952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5243',
internalId:  '',
customField: '20091229-190009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5264',
internalId:  '',
customField: '20091229-152014'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5285',
internalId:  '',
customField: '20091229-184511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5306',
internalId:  '',
customField: '20100620-144158'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5501',
internalId:  '',
customField: '20091203-171509'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5327',
internalId:  '',
customField: '20100118-204943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5348',
internalId:  '',
customField: '20091130-233606'
};
webappMappings['4001']=webappMappings['4001-17583057']={
webappId:    '4001',
documentId:  '5501',
internalId:  '17583057',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21022',
internalId:  '',
customField: '20100620-145241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18601',
internalId:  '',
customField: '20091229-215119'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21001',
internalId:  '',
customField: '20100118-203632'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20901',
internalId:  '',
customField: '20091229-214411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20922',
internalId:  '',
customField: '20091229-214556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21043',
internalId:  '',
customField: '20091229-173150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22601',
internalId:  '',
customField: '20091229-215014'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33622',
internalId:  '',
customField: '20100207-170318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26401',
internalId:  '',
customField: '20100105-154943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31601',
internalId:  '',
customField: '20091229-234022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33601',
internalId:  '',
customField: '20100207-170232'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33643',
internalId:  '',
customField: '20100207-170342'
};
var canonHostname = 'wsc1.brinkster.com';
var accountId     = 'ABR330INZCGZ';
var companyName   = 'NORTHWEST+BASEBALL+INSTITUTE';
var htmlTitle	  = 'NORTHWEST+BASEBALL+INSTITUTE';
var metaKeywords  = '';
var metaContents  = 'The+Northwest+Baseball+Institute+and+the+Northwest+Fastpitch+Academy+offers+personalized+instruction+to+students+that+desire+to+improve+their+fundamental+skills+and+become+better+players.+';
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();
};
