/* [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','901',jdecode('Home'),jdecode(''),'/901.html','true',[],'',''],
	['PAGE','952',jdecode('Menu'),jdecode(''),'/952/index.html','true',[ 
		['PAGE','41202',jdecode('Lunch+Specials'),jdecode(''),'/952/41202.html','true',[],'',''],
		['PAGE','973',jdecode('Sand.%2C+Salads+%26+Apps.'),jdecode(''),'/952/973.html','true',[],'',''],
		['PAGE','994',jdecode('Pizzas'),jdecode(''),'/952/994.html','true',[],'',''],
		['PAGE','1015',jdecode('Beverages'),jdecode(''),'/952/1015.html','true',[],'',''],
		['PAGE','33088',jdecode('Desserts'),jdecode(''),'/952/33088.html','true',[],'',''],
		['PAGE','32611',jdecode('Coupon'),jdecode(''),'/952/32611.html','true',[],'','']
	],'',''],
	['PAGE','14412',jdecode('Delivery+Policy'),jdecode(''),'/14412.html','true',[],'',''],
	['PAGE','1036',jdecode('Parties+'),jdecode(''),'/1036/index.html','true',[ 
		['PAGE','33235',jdecode('Group+Tours'),jdecode(''),'/1036/33235.html','true',[],'','']
	],'',''],
	['PAGE','18412',jdecode('Fundraisers'),jdecode(''),'/18412.html','true',[],'',''],
	['PAGE','31448',jdecode('Catering'),jdecode(''),'/31448.html','true',[],'',''],
	['PAGE','1057',jdecode('Location%2F+Contact+Us'),jdecode(''),'/1057.html','true',[],'',''],
	['PAGE','1078',jdecode('About+Us'),jdecode(''),'/1078.html','true',[],'',''],
	['PAGE','32591',jdecode('FAQ'),jdecode(''),'/32591.html','true',[],'',''],
	['PAGE','1099',jdecode('Event+Calendar'),jdecode(''),'/1099.html','true',[],'',''],
	['PAGE','31896',jdecode('BallPark+Family+Pics'),jdecode(''),'/31896.html','true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Borders';
theSitetree.paletteFamily='A6CBB5';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10432';
theSitetree.graphicsetId='10774';
theSitetree.contentColor='692643';
theSitetree.contentBGColor='FEFEF8';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Borders',
				paletteFamily: 	'A6CBB5',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10432',
				graphicsetId: 	'10774',
				contentColor: 	'692643',
				contentBGColor: 'FEFEF8',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1099',
internalId:  '',
customField: '20100830-030907'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '901',
internalId:  '',
customField: '20100826-213133'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '952',
internalId:  '',
customField: '20100601-153927'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '973',
internalId:  '',
customField: '20100214-185342'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '994',
internalId:  '',
customField: '20100208-195427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1015',
internalId:  '',
customField: '20100811-205014'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33235',
internalId:  '',
customField: '20090904-183904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14412',
internalId:  '',
customField: '20090621-172852'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1036',
internalId:  '',
customField: '20100507-193013'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18412',
internalId:  '',
customField: '20090525-141742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31448',
internalId:  '',
customField: '20090525-142538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1057',
internalId:  '',
customField: '20090525-142700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1078',
internalId:  '',
customField: '20100824-133429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31896',
internalId:  '',
customField: '20090525-143624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32611',
internalId:  '',
customField: '20100501-174411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32591',
internalId:  '',
customField: '20090525-143602'
};
webappMappings['7060']=webappMappings['7060-2b1385e3a1772817fb5382e9234da96e']={
webappId:    '7060',
documentId:  '31896',
internalId:  '2b1385e3a1772817fb5382e9234da96e',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33088',
internalId:  '',
customField: '20100408-184642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41202',
internalId:  '',
customField: '20100129-174903'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050IN2UPS';
var companyName   = 'BallPark+Pizza+Team';
var htmlTitle	  = 'BallPark+Pizza+Team';
var metaKeywords  = 'pizza+++Rancho+Santa+Margarita++BallPark+Pizza+Team++BallPark+Pizza++Ball+Park+Pizza';
var metaContents  = 'Rancho+Santa+Margarita+sports+themed+pizza+parlor++Ball+park+pizza+rancho+santa+margarita++BallPark+pizza++Ball+Park+Pizza++Ball+Park+Pizza+Team++';
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();
};
