/* [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','1701',jdecode('Grace+%26+Tony%26%23x27%3Bs'),jdecode(''), jdecode('%2F1701.html'), 'true',[],'',''],
	['PAGE','20701',jdecode('Catering'),jdecode(''), jdecode('%2F20701.html'), 'true',[],'',''],
	['PAGE','33401',jdecode('Hors+D%26%23x27%3Boeuvres'),jdecode(''), jdecode('%2F33401.html'), 'true',[],'',''],
	['PAGE','40101',jdecode('Appetizer+Platters'),jdecode(''), jdecode('%2F40101.html'), 'true',[],'',''],
	['PAGE','35101',jdecode('Salad'),jdecode(''), jdecode('%2F35101.html'), 'true',[],'',''],
	['PAGE','35301',jdecode('Cold+Displays'),jdecode(''), jdecode('%2F35301.html'), 'true',[],'',''],
	['PAGE','35501',jdecode('Carving+Station'),jdecode(''), jdecode('%2F35501.html'), 'false',[],'',''],
	['PAGE','35701',jdecode('Pasta+'),jdecode(''), jdecode('%2F35701.html'), 'true',[],'',''],
	['PAGE','36001',jdecode('Chicken'),jdecode(''), jdecode('%2F36001.html'), 'true',[],'',''],
	['PAGE','36201',jdecode('Beef'),jdecode(''), jdecode('%2F36201.html'), 'false',[],'',''],
	['PAGE','36401',jdecode('Veal'),jdecode(''), jdecode('%2F36401.html'), 'true',[],'',''],
	['PAGE','36601',jdecode('Seafood'),jdecode(''), jdecode('%2F36601.html'), 'true',[],'',''],
	['PAGE','36701',jdecode('Side+Dishes'),jdecode(''), jdecode('%2F36701.html'), 'true',[],'',''],
	['PAGE','36901',jdecode('Wraps+or+Sandwiches'),jdecode(''), jdecode('%2F36901.html'), 'false',[],'',''],
	['PAGE','37501',jdecode('Soups+%26+Chili'),jdecode(''), jdecode('%2F37501.html'), 'true',[],'',''],
	['PAGE','37301',jdecode('Southern+BBQ'),jdecode(''), jdecode('%2F37301.html'), 'true',[],'',''],
	['PAGE','45501',jdecode('Clam+Bake'),jdecode(''), jdecode('%2F45501.html'), 'true',[],'',''],
	['PAGE','39601',jdecode('Trays'),jdecode(''), jdecode('%2F39601.html'), 'true',[],'',''],
	['PAGE','37001',jdecode('Breakfast'),jdecode(''), jdecode('%2F37001.html'), 'false',[],'',''],
	['PAGE','41201',jdecode('Breakfast+Packages'),jdecode(''), jdecode('%2F41201.html'), 'false',[],'',''],
	['PAGE','40801',jdecode('Luncheon+Packages'),jdecode(''), jdecode('%2F40801.html'), 'false',[],'',''],
	['PAGE','40901',jdecode('Party+Subs'),jdecode(''), jdecode('%2F40901.html'), 'false',[],'',''],
	['PAGE','26701',jdecode('Gourmet+Cupcakes'),jdecode(''), jdecode('%2F26701.html'), 'true',[],'',''],
	['PAGE','4501',jdecode('Contact+Us'),jdecode(''), jdecode('%2F4501.html'), 'true',[],'',''],
	['PAGE','20722',jdecode('Local+Weather'),jdecode(''), jdecode('%2F20722.html'), 'true',[],'',''],
	['PAGE','20743',jdecode('Guestbook'),jdecode(''), jdecode('%2F20743.html'), 'false',[],'','']];
var siteelementCount=26;
theSitetree.topTemplateName='Restaurant';
theSitetree.paletteFamily='50423D';
theSitetree.keyvisualId='11902';
theSitetree.keyvisualName='kv_11902.jpg';
theSitetree.fontsetId='33192';
theSitetree.graphicsetId='14092';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp35-attweb',
  product: 'WSCSYSSSSLYTC2ZA'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Restaurant',
				paletteFamily: 	'50423D',
				keyvisualId: 	'11902',
				keyvisualName: 	'kv_11902.jpg',
				fontsetId: 		'33192',
				graphicsetId: 	'14092',
				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:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1701',
internalId:  '',
customField: '20110624-114720'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33401',
internalId:  '',
customField: '20110624-121715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45501',
internalId:  '',
customField: '20110624-100702'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1701',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '1701',
internalId:  '1501',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4501',
internalId:  '',
customField: '20110624-100123'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35301',
internalId:  '',
customField: '20110624-103428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35701',
internalId:  '',
customField: '20110624-095531'
};
webappMappings['7080']=webappMappings['7080-864']={
webappId:    '7080',
documentId:  '20722',
internalId:  '864',
customField: 'language:en;country:US;'
};
webappMappings['1002']=webappMappings['1002-20743avfl30inh7nf']={
webappId:    '1002',
documentId:  '20743',
internalId:  '20743avfl30inh7nf',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20722',
internalId:  '',
customField: '20100605-144351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20743',
internalId:  '',
customField: '20100605-144433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20701',
internalId:  '',
customField: '20110624-113327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35101',
internalId:  '',
customField: '20110624-102543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26701',
internalId:  '',
customField: '20110624-100102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35501',
internalId:  '',
customField: '20101220-183547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36001',
internalId:  '',
customField: '20110624-100142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36201',
internalId:  '',
customField: '20101221-175900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36401',
internalId:  '',
customField: '20110624-100221'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36601',
internalId:  '',
customField: '20110624-103659'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36901',
internalId:  '',
customField: '20101221-175424'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37001',
internalId:  '',
customField: '20101222-093642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37301',
internalId:  '',
customField: '20110624-110807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37501',
internalId:  '',
customField: '20110624-120356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36701',
internalId:  '',
customField: '20110624-095739'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39601',
internalId:  '',
customField: '20110624-100041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40101',
internalId:  '',
customField: '20110624-120919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40801',
internalId:  '',
customField: '20101222-151419'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40901',
internalId:  '',
customField: '20101222-150834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41201',
internalId:  '',
customField: '20101222-151745'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INH7NF';
var companyName   = 'Grace+%26+Tony%27s+Catering+%28203%29+685-6068';
var htmlTitle	  = 'Grace+%26+Tony%27s+Catering';
var metaKeywords  = 'Catering%2C+Caterer';
var metaContents  = 'Catering%2C+Caterer';
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();
};

