/* [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(''), jdecode('%2F901.html'), 'true',[],'',''],
	['PAGE','952',jdecode('Menu'),jdecode(''), jdecode('%2F952%2Findex.html'), 'true',[ 
		['PAGE','41202',jdecode('Lunch+Specials'),jdecode(''), jdecode('%2F952%2F41202.html'), 'true',[],'',''],
		['PAGE','973',jdecode('Sand.%2C+Salads+%26+Apps.'),jdecode(''), jdecode('%2F952%2F973.html'), 'true',[],'',''],
		['PAGE','994',jdecode('Pizzas'),jdecode(''), jdecode('%2F952%2F994.html'), 'true',[],'',''],
		['PAGE','1015',jdecode('Beverages'),jdecode(''), jdecode('%2F952%2F1015.html'), 'true',[],'',''],
		['PAGE','33088',jdecode('Desserts'),jdecode(''), jdecode('%2F952%2F33088.html'), 'true',[],'',''],
		['PAGE','32611',jdecode('Coupon'),jdecode(''), jdecode('%2F952%2F32611.html'), 'true',[],'',''],
		['PAGE','75841',jdecode('Printable+Menu'),jdecode(''), jdecode('%2F952%2F75841.html'), 'true',[],'','']
	],'',''],
	['PAGE','14412',jdecode('Delivery+Policy'),jdecode(''), jdecode('%2F14412.html'), 'true',[],'',''],
	['PAGE','1036',jdecode('Parties+'),jdecode(''), jdecode('%2F1036%2Findex.html'), 'true',[ 
		['PAGE','33235',jdecode('Group+Tours'),jdecode(''), jdecode('%2F1036%2F33235.html'), 'true',[],'','']
	],'',''],
	['PAGE','18412',jdecode('Fundraisers'),jdecode(''), jdecode('%2F18412.html'), 'true',[],'',''],
	['PAGE','31448',jdecode('Catering'),jdecode(''), jdecode('%2F31448.html'), 'true',[],'',''],
	['PAGE','1057',jdecode('Location%2F+Contact+Us'),jdecode(''), jdecode('%2F1057.html'), 'true',[],'',''],
	['PAGE','1078',jdecode('About+Us'),jdecode(''), jdecode('%2F1078.html'), 'true',[],'',''],
	['PAGE','32591',jdecode('FAQ'),jdecode(''), jdecode('%2F32591.html'), 'true',[],'',''],
	['PAGE','1099',jdecode('Event+Calendar'),jdecode(''), jdecode('%2F1099.html'), 'true',[],'',''],
	['PAGE','31896',jdecode('BallPark+Family+Pics'),jdecode(''), jdecode('%2F31896.html'), 'true',[],'',''],
	['PAGE','79041',jdecode('Join+the+Team'),jdecode(''), jdecode('%2F79041.html'), 'true',[],'','']];
var siteelementCount=20;
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 prodDef={
  wl_name: 'valueweb',
  product: 'WSCSYSSSSLYTCR7V'
};
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: '20120109-183655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '901',
internalId:  '',
customField: '20120119-220757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '952',
internalId:  '',
customField: '20120119-220309'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '973',
internalId:  '',
customField: '20120119-221457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '994',
internalId:  '',
customField: '20110331-211316'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1015',
internalId:  '',
customField: '20120119-221301'
};
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: '20120106-144950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1078',
internalId:  '',
customField: '20110601-135247'
};
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: '20110601-134730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41202',
internalId:  '',
customField: '20110331-211857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75841',
internalId:  '',
customField: '20110902-175403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79041',
internalId:  '',
customField: '20120123-234858'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
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();
};

