/* [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','35812',jdecode('Home'),jdecode(''), jdecode('%2F35812.html'), 'true',[],'',''],
	['PAGE','1815',jdecode('Opening+hours%2F+Prices'),jdecode(''), jdecode('%2F1815.html'), 'true',[],'',''],
	['PAGE','94023',jdecode('Fall+2012+Leagues'),jdecode(''), jdecode('%2F94023.html'), 'true',[],'',''],
	['PAGE','6322',jdecode('Summer+Leagues+2010'),jdecode(''), jdecode('%2F6322.html'), 'false',[],'',''],
	['PAGE','19512',jdecode('Upcoming+Events'),jdecode(''), jdecode('%2F19512.html'), 'true',[],'',''],
	['PAGE','114023',jdecode('Summer+Leagues+2011'),jdecode(''), jdecode('%2F114023%2Findex.html'), 'false',[ 
		['PAGE','12512',jdecode('Fall+JR+Leagues+2011'),jdecode(''), jdecode('%2F114023%2F12512.html'), 'false',[],'',''],
		['PAGE','12312',jdecode('Winter+Leagues+2010'),jdecode(''), jdecode('%2F114023%2F12312.html'), 'false',[],'','']
	],'',''],
	['PAGE','26412',jdecode('League%2FEvent+Sign+Up'),jdecode(''), jdecode('%2F26412.html'), 'true',[],'',''],
	['PAGE','1878',jdecode('Special+offers%2FPromotions'),jdecode(''), jdecode('%2F1878.html'), 'true',[],'',''],
	['PAGE','78612',jdecode('Kids+Bowl+Free'),jdecode(''), jdecode('%2F78612.html'), 'true',[],'',''],
	['PAGE','61812',jdecode('Brookhaven+Free+Library'),jdecode(''), jdecode('%2F61812.html'), 'false',[],'',''],
	['PAGE','46012',jdecode('Sportstop+Bowler%26%23x27%3Bs+Shop'),jdecode(''), jdecode('%2F46012.html'), 'true',[],'',''],
	['PAGE','13633',jdecode('Upcoming+Tournaments'),jdecode(''), jdecode('%2F13633.html'), 'false',[],'',''],
	['PAGE','10712',jdecode('JR+Birthday+Party+Packages'),jdecode(''), jdecode('%2F10712.html'), 'true',[],'',''],
	['PAGE','39033',jdecode('Group+Events+%26+Parties'),jdecode(''), jdecode('%2F39033%2Findex.html'), 'true',[ 
		['PAGE','13612',jdecode('Charity+Events'),jdecode(''), jdecode('%2F39033%2F13612.html'), 'true',[],'','']
	],'',''],
	['PAGE','12912',jdecode('Discover+Bowlopolis'),jdecode(''), jdecode('%2F12912.html'), 'true',[],'',''],
	['PAGE','30912',jdecode('Links'),jdecode(''), jdecode('%2F30912.html'), 'true',[],'',''],
	['PAGE','3701',jdecode('Virtual+Tour'),jdecode(''), jdecode('%2F3701.html'), 'true',[],'',''],
	['PAGE','6301',jdecode('Latest+News'),jdecode(''), jdecode('%2F6301.html'), 'true',[],'',''],
	['PAGE','1899',jdecode('Contact'),jdecode(''), jdecode('%2F1899.html'), 'true',[],'',''],
	['PAGE','1752',jdecode('About+us'),jdecode(''), jdecode('%2F1752%2Findex.html'), 'true',[ 
		['PAGE','1773',jdecode('Our+team'),jdecode(''), jdecode('%2F1752%2F1773.html'), 'true',[],'',''],
		['PAGE','1794',jdecode('How+to+find+us'),jdecode(''), jdecode('%2F1752%2F1794.html'), 'true',[],'','']
	],'',''],
	['PAGE','23612',jdecode('How+to+Choose+a+League+Cont...'),jdecode(''), jdecode('%2F23612.html'), 'false',[],'',''],
	['PAGE','26512',jdecode('League+listing'),jdecode(''), jdecode('%2F26512.html'), 'false',[],'',''],
	['PAGE','16312',jdecode('News+Archive'),jdecode(''), jdecode('%2F16312.html'), 'false',[],'',''],
	['PAGE','116123',jdecode('New+page'),jdecode(''), jdecode('%2F116123.html'), 'false',[],'','']];
var siteelementCount=29;
theSitetree.topTemplateName='Contrast';
theSitetree.paletteFamily='363C95';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='16628';
theSitetree.graphicsetId='12215';
theSitetree.contentColor='191E6D';
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: 	'363C95',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'16628',
				graphicsetId: 	'12215',
				contentColor: 	'191E6D',
				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['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '61812',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1752',
internalId:  '',
customField: '20090930-105826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1773',
internalId:  '',
customField: '20110416-114706'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1794',
internalId:  '',
customField: '20090324-092059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1815',
internalId:  '',
customField: '20111130-185202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3701',
internalId:  '',
customField: '20090515-141502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30912',
internalId:  '',
customField: '20091001-091042'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1878',
internalId:  '',
customField: '20120217-150517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1899',
internalId:  '',
customField: '20100605-191843'
};
webappMappings['7060']=webappMappings['7060-657bc7fe9dac0a152a36b59aa9fe7dd0']={
webappId:    '7060',
documentId:  '3701',
internalId:  '657bc7fe9dac0a152a36b59aa9fe7dd0',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6301',
internalId:  '',
customField: '20100824-183555'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6322',
internalId:  '',
customField: '20100830-192555'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '35812',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12312',
internalId:  '',
customField: '20100304-183057'
};
webappMappings['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '35812',
internalId:  '1501',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10712',
internalId:  '',
customField: '20110111-112314'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12512',
internalId:  '',
customField: '20090723-170045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12912',
internalId:  '',
customField: '20110416-113925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13612',
internalId:  '',
customField: '20090929-203036'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13633',
internalId:  '',
customField: '20101013-151016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61812',
internalId:  '',
customField: '20091216-131230'
};
webappMappings['1501']=webappMappings['1501-4902017']={
webappId:    '1501',
documentId:  '35812',
internalId:  '4902017',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16312',
internalId:  '',
customField: '20090929-201314'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19512',
internalId:  '',
customField: '20120217-152426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23612',
internalId:  '',
customField: '20090901-194844'
};
webappMappings['7008']=webappMappings['7008-4700']={
webappId:    '7008',
documentId:  '26412',
internalId:  '4700',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26412',
internalId:  '',
customField: '20120217-151644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26512',
internalId:  '',
customField: '20090901-213715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35812',
internalId:  '',
customField: '20120216-151926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39033',
internalId:  '',
customField: '20110416-113822'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46012',
internalId:  '',
customField: '20111130-185527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78612',
internalId:  '',
customField: '20110418-154244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94023',
internalId:  '',
customField: '20110811-130352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '114023',
internalId:  '',
customField: '20110418-160019'
};
webappMappings['7060']=webappMappings['7060-abc96532c6daf3358482368e5179e9db']={
webappId:    '7060',
documentId:  '116123',
internalId:  'abc96532c6daf3358482368e5179e9db',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '116123',
internalId:  '',
customField: '20111008-095939'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INL4JZ';
var companyName   = 'BOWL+LONG+ISLAND+at+PATCHOGUE';
var htmlTitle	  = 'Bowl+Long+Island+at+Patchogue';
var metaKeywords  = 'Bowling%2C+Fun%2C+Strike%2C+Spare%2C+Bar%2C+Food%2C+Games%2C+Leagues%2C+League%2C+Summer%2C+Winter%2C+Bowling+Ball%2C+Bowling+Bag%2C+Bowling+Shoes%2C+Childrens+Birthday+Party%2C+Parties%2C+11772%2C+Party%2C+Bowl%2C+Indoor%2C+Birthday%2C+Party%2C+Play%2C+Family%2C+Coupons%2C+Bar%2C+Tournaments%2C+long+island%2C+corporate+party%2C+patchogue%2C+fun%2C+drink+specials%2C+strike%2C+spare%2C+inexpensive%2C+bachelor+party%2C+family+reunion%2C+anniversary%2C+free+bowling%2C+beer%2C+night+life%2C+extreme%2C+midnight%2C+rock+and+bowl';
var metaContents  = 'Bowl+Long+Island+at+Patchogue%2C+Long+Islands+Newest+Most+Modern+Bowling+Center.+40+Bowling+Lanes+in+Patchogue%2C+Long+Island%2C+New+York+11772';
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();
};

