/* [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(''), jdecode('%2F5601.html'), 'true',[],'',''],
	['PAGE','5652',jdecode('About+the+Bats'),jdecode(''), jdecode('%2F5652%2Findex.html'), 'true',[ 
		['PAGE','5673',jdecode('History'),jdecode(''), jdecode('%2F5652%2F5673.html'), 'true',[],'','']
	],'',''],
	['PAGE','5715',jdecode('Your+BlueGrass+Bats'),jdecode(''), jdecode('%2F5715.html'), 'true',[],'',''],
	['PAGE','33301',jdecode('Schedule%2FGuestbook'),jdecode(''), jdecode('%2F33301.html'), 'true',[],'',''],
	['PAGE','5736',jdecode('Bat+News'),jdecode(''), jdecode('%2F5736.html'), 'true',[],'',''],
	['PAGE','5778',jdecode('Bat+Links'),jdecode(''), jdecode('%2F5778.html'), 'true',[],'',''],
	['PAGE','11101',jdecode('Bat+Photos'),jdecode(''), jdecode('%2F11101.html'), 'true',[],'',''],
	['PAGE','25101',jdecode('More+Photos'),jdecode(''), jdecode('%2F25101.html'), 'true',[],'',''],
	['PAGE','173712',jdecode('Tournament+Info'),jdecode(''), jdecode('%2F173712.html'), 'true',[],'',''],
	['PAGE','173733',jdecode('Coaches+Corner'),jdecode(''), jdecode('%2F173733.html'), 'true',[],'',''],
	['PAGE','212473',jdecode('Fan+merchandising'),jdecode(''), jdecode('%2F212473.html'), 'true',[],'',''],
	['PAGE','179512',jdecode('Bat+Donors'),jdecode(''), jdecode('%2F179512.html'), 'true',[],'',''],
	['PAGE','179533',jdecode('BATs+II'),jdecode(''), jdecode('%2F179533.html'), 'true',[],'',''],
	['PAGE','212431',jdecode('BATS+II+Coaches'),jdecode(''), jdecode('%2F212431.html'), 'true',[],'',''],
	['PAGE','184231',jdecode('Bat+II+Profiles'),jdecode(''), jdecode('%2F184231.html'), 'true',[],'',''],
	['PAGE','192231',jdecode('Bats+II+News'),jdecode(''), jdecode('%2F192231.html'), 'true',[],'',''],
	['PAGE','209431',jdecode('College+BATS'),jdecode(''), jdecode('%2F209431.html'), 'true',[],'','']];
var siteelementCount=18;
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 prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRN4'
};
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: '20111109-212155'
};
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: '20110710-214712'
};
webappMappings['1002']=webappMappings['1002-33301aendu0ineye2']={
webappId:    '1002',
documentId:  '33301',
internalId:  '33301aendu0ineye2',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5736',
internalId:  '',
customField: '20111107-195810'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5778',
internalId:  '',
customField: '20110419-232947'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25101',
internalId:  '',
customField: '20110629-203741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11101',
internalId:  '',
customField: '20111109-211917'
};
webappMappings['1501']=webappMappings['1501-13532515']={
webappId:    '1501',
documentId:  '5601',
internalId:  '13532515',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33301',
internalId:  '',
customField: '20110419-233346'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '179512',
internalId:  '',
customField: '20100708-213842'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '173712',
internalId:  '',
customField: '20111109-210534'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '173733',
internalId:  '',
customField: '20110414-225301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '179533',
internalId:  '',
customField: '20110710-220158'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '184231',
internalId:  '',
customField: '20100702-175020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '192231',
internalId:  '',
customField: '20110531-232854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '209431',
internalId:  '',
customField: '20110825-230230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '212473',
internalId:  '',
customField: '20110517-003946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '212431',
internalId:  '',
customField: '20110526-233835'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker01.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();
};

