/* [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','32',jdecode('Home'),jdecode(''), jdecode('%2F32.html'), 'true',[],'',''],
	['PAGE','62434',jdecode('SUMMER+CAMPS'),jdecode(''), jdecode('%2F62434.html'), 'true',[],'',''],
	['PAGE','62534',jdecode('WINTER+RECESS+CAMP'),jdecode(''), jdecode('%2F62534.html'), 'true',[],'',''],
	['PAGE','58555',jdecode('Team+Winter+Workouts'),jdecode(''), jdecode('%2F58555.html'), 'true',[],'',''],
	['PAGE','55734',jdecode('Birthday+Parties'),jdecode(''), jdecode('%2F55734.html'), 'true',[],'',''],
	['PAGE','57834',jdecode('Camp+Photos'),jdecode(''), jdecode('%2F57834.html'), 'true',[],'',''],
	['PAGE','2840',jdecode('Cage+Rental'),jdecode(''), jdecode('%2F2840.html'), 'true',[],'',''],
	['PAGE','53',jdecode('VIEW+the+cages'),jdecode(''), jdecode('%2F53.html'), 'true',[],'',''],
	['PAGE','71',jdecode('Contact+Info%2FAbout+Us'),jdecode(''), jdecode('%2F71.html'), 'true',[],'',''],
	['PAGE','2695',jdecode('Baseball%2FSoftball+Trainers'),jdecode(''), jdecode('%2F2695.html'), 'true',[],'',''],
	['PAGE','2621',jdecode('Guestbook'),jdecode(''), jdecode('%2F2621%2Findex.html'), 'true',[ 
		['PAGE','2620',jdecode('Read+Guestbook'),jdecode(''), jdecode('%2F2621%2F2620.html'), 'false',[],'','']
	],'','']];
var siteelementCount=12;
theSitetree.topTemplateName='Contrast';
theSitetree.paletteFamily='B42F2F';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='16627';
theSitetree.graphicsetId='12213';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'optimum',
  product: 'WSCSYSSSSLYTC245'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Contrast',
				paletteFamily: 	'B42F2F',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'16627',
				graphicsetId: 	'12213',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '32',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62434',
internalId:  '',
customField: '20120131-181811'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57834',
internalId:  '',
customField: '20110922-134027'
};
webappMappings['1002']=webappMappings['1002-2621AHW050IN32QA']={
webappId:    '1002',
documentId:  '2621',
internalId:  '2621AHW050IN32QA',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32',
internalId:  '',
customField: '20120106-165941'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55734',
internalId:  '',
customField: '20111215-111804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2840',
internalId:  '',
customField: '20110115-165330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2695',
internalId:  '',
customField: '20120106-170552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58555',
internalId:  '',
customField: '20120106-165949'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53',
internalId:  '',
customField: '20110115-165550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62534',
internalId:  '',
customField: '20120131-181949'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71',
internalId:  '',
customField: '20111121-151946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2621',
internalId:  '',
customField: '20090114-194128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2620',
internalId:  '',
customField: '20080223-174258'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC245']={
webappId:    '5003',
documentId:  '32',
internalId:  'tid:1;pid:WSCSYSSSSLYTC245',
customField: 'en:US::;language:en;country:US;'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050IN32QA';
var companyName   = '';
var htmlTitle	  = 'Batting+1.000%2C+57+Hanse+Avenue%2C+Freeport%2C+NY+Indoor+Batting+Cages+-+Baseball+Softball';
var metaKeywords  = 'Batting+1000%2C+www.battinga1000.com%2C+1.000%2C+Cage%2C+Cages%2C+Long+Island%2C+Baseball%2C+Softball%2C+Patricia+Langdon%2C+travel+team%2C+bat%2C+softball+training+1000%2C+baseball+training%2C+trainer%2C+pitching%2C+hitting%2C+Freeport%2C+new+facility%2C+baseball%2C+softball%2C+batting%2C+batting%2C+batting%2C+baseball%2C+baseball%2C+baseball+team+training+batting+cages+batting+cages+Freeport+Freeport+Freeport+Freeport+Freeport+Freeport+Freeport+Freeport+Freeport+Nassau+Nassau+Nassau+Nassau+Nassau';
var metaContents  = 'Indoor+batting+cages%2C+baseball+softball+training+facility%2C+professional+baseball+and+softball+trainers%2C+team+and+individual+cage+rentals%2C++located+57+Hanse+Avenue%2C+Freeport%2C+NY+www.battinga1000.com';
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();
};

