/* [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','5601',jdecode('Bat+Cave'),jdecode(''),'/5601.html','true',[],'',''],
	['PAGE','5652',jdecode('About+the+Bats'),jdecode(''),'/5652/index.html','true',[ 
		['PAGE','5673',jdecode('History'),jdecode(''),'/5652/5673.html','true',[],'','']
	],'',''],
	['PAGE','5715',jdecode('Your+BlueGrass+Bats'),jdecode(''),'/5715.html','true',[],'',''],
	['PAGE','33301',jdecode('Schedule%2FGuestbook'),jdecode(''),'/33301.html','true',[],'',''],
	['PAGE','5736',jdecode('Bat+News'),jdecode(''),'/5736.html','true',[],'',''],
	['PAGE','5778',jdecode('Bat+Links'),jdecode(''),'/5778.html','true',[],'',''],
	['PAGE','11101',jdecode('Bat+Photos'),jdecode(''),'/11101.html','true',[],'',''],
	['PAGE','25101',jdecode('More+Photos'),jdecode(''),'/25101.html','true',[],'',''],
	['PAGE','173712',jdecode('Tournament+Info'),jdecode(''),'/173712.html','true',[],'',''],
	['PAGE','173733',jdecode('Coaches+Corner'),jdecode(''),'/173733.html','true',[],'',''],
	['PAGE','179512',jdecode('Bat+Donors'),jdecode(''),'/179512.html','true',[],'',''],
	['PAGE','179533',jdecode('BATs+II'),jdecode(''),'/179533.html','true',[],'',''],
	['PAGE','184231',jdecode('Bat+II+Profiles'),jdecode(''),'/184231.html','true',[],'',''],
	['PAGE','192231',jdecode('Bats+II+News'),jdecode(''),'/192231.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Orbit';
theSitetree.paletteFamily='003366';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='172';
theSitetree.graphicsetId='203';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='003366';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Orbit',
				paletteFamily: 	'003366',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'172',
				graphicsetId: 	'203',
				contentColor: 	'FFFFFF',
				contentBGColor: '003366',
				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:  '5601',
internalId:  '',
customField: '20100828-182213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5652',
internalId:  '',
customField: '20100605-160737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5673',
internalId:  '',
customField: '20100413-001837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5715',
internalId:  '',
customField: '20100804-204230'
};
webappMappings['1002']=webappMappings['1002-33301aendu0ineye2']={
webappId:    '1002',
documentId:  '33301',
internalId:  '33301aendu0ineye2',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5736',
internalId:  '',
customField: '20100810-234824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5778',
internalId:  '',
customField: '20100715-172349'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25101',
internalId:  '',
customField: '20100527-235338'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11101',
internalId:  '',
customField: '20100810-232011'
};
webappMappings['1501']=webappMappings['1501-13532515']={
webappId:    '1501',
documentId:  '5601',
internalId:  '13532515',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33301',
internalId:  '',
customField: '20100810-233202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '179512',
internalId:  '',
customField: '20100708-213842'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '173712',
internalId:  '',
customField: '20100803-204235'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '173733',
internalId:  '',
customField: '20100726-230754'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '179533',
internalId:  '',
customField: '20100713-201639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '184231',
internalId:  '',
customField: '20100702-175020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '192231',
internalId:  '',
customField: '20100809-215807'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INEYE2';
var companyName   = 'BlueGrass+Bats+Lacrosse+Club';
var htmlTitle	  = 'BlueGrass+Bats+Lacrosse';
var metaKeywords  = 'kentucky+laxbats+laxbluegrass+lacrosselacrosseKentucky+lacrosselouisville+lacrosse+kentucky+clubs%2C+louisville+lacrosse%2C+elite+kentucky+lacrosse%2C+club+lacrosse%2C+bluegrass%2C+kentucky+bats%2C+travel%2C+kentucky+travel+team%2C+ky+lax';
var metaContents  = 'BlueGrass+Bats+LAX';
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();
};
