/* [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 theSitetree=[ 
	['PAGE','2801',jdecode('Karen%26%23x27%3Bs+Catering'),jdecode(''),'/2801.html','true',[],''],
	['PAGE','4401',jdecode('Our+Services'),jdecode(''),'/4401/index.html','true',[ 
		['PAGE','17801',jdecode('Event+Planning'),jdecode(''),'/4401/17801.html','true',[],''],
		['PAGE','9901',jdecode('Venues'),jdecode(''),'/4401/9901.html','true',[],''],
		['PAGE','23601',jdecode('Staff'),jdecode(''),'/4401/23601.html','true',[],'']
	],''],
	['PAGE','4422',jdecode('+Menus'),jdecode(''),'/4422/index.html','true',[ 
		['PAGE','4443',jdecode('Stations'),jdecode(''),'/4422/4443.html','true',[],''],
		['PAGE','20501',jdecode('Coursed+Out+%2F+Plated'),jdecode(''),'/4422/20501.html','true',[],''],
		['PAGE','20522',jdecode('Luncheon'),jdecode(''),'/4422/20522.html','true',[],''],
		['PAGE','27001',jdecode('Buffet'),jdecode(''),'/4422/27001.html','true',[],''],
		['PAGE','51301',jdecode('Hors+d%26%23x27%3Boeuvers'),jdecode(''),'/4422/51301.html','true',[],'']
	],''],
	['PAGE','4485',jdecode('Contact+Us'),jdecode(''),'/4485/index.html','true',[ 
		['PAGE','64432',jdecode('Email+Us'),jdecode(''),'/4485/64432.html','true',[],''],
		['PAGE','64241',jdecode('Guestbook'),jdecode(''),'/4485/64241.html','true',[],''],
		['PAGE','64250',jdecode('Picture+Post'),jdecode(''),'/4485/64250.html','true',[],''],
		['PAGE','64272',jdecode('Tastings+%2F+Map'),jdecode(''),'/4485/64272.html','true',[],'']
	],''],
	['PAGE','4464',jdecode('Links'),jdecode(''),'/4464.html','true',[],'']];
var siteelementCount=17;
theSitetree.topTemplateName='Snapshot';
theSitetree.paletteFamily='AB354B';
theSitetree.keyvisualId='3635';
theSitetree.keyvisualName='kv_3635.jpg';
theSitetree.fontsetId='10458';
theSitetree.graphicsetId='10874';
theSitetree.contentColor='CCCCCC';
theSitetree.contentBGColor='AB354B';
var theTemplate={
				name: 			'Snapshot',
				paletteFamily: 	'AB354B',
				keyvisualId: 	'3635',
				keyvisualName: 	'kv_3635.jpg',
				fontsetId: 		'10458',
				graphicsetId: 	'10874',
				contentColor: 	'CCCCCC',
				contentBGColor: 'AB354B',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FC5E7B',
				e_color: 		'BFBFBF',
				f_color: 		'050001',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2801',
internalId:  '',
customField: '20100302-165503'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4401',
internalId:  '',
customField: '20100302-161044'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9901',
internalId:  '',
customField: '20100301-132336'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4464',
internalId:  '',
customField: '20100302-181645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17801',
internalId:  '',
customField: '20080410-174208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23601',
internalId:  '',
customField: '20080419-023958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4422',
internalId:  '',
customField: '20080419-023714'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4443',
internalId:  '',
customField: '20080417-151856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20501',
internalId:  '',
customField: '20080417-152350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20522',
internalId:  '',
customField: '20080417-100150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27001',
internalId:  '',
customField: '20080417-153236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51301',
internalId:  '',
customField: '20100301-131254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4485',
internalId:  '',
customField: '20100302-165557'
};
webappMappings['1002']=webappMappings['1002-64241ahw050inev3e']={
webappId:    '1002',
documentId:  '64241',
internalId:  '64241ahw050inev3e',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64241',
internalId:  '',
customField: '20100302-163431'
};
webappMappings['7060']=webappMappings['7060-de61285ef33d1b7a5c851f7d526329e9']={
webappId:    '7060',
documentId:  '64250',
internalId:  'de61285ef33d1b7a5c851f7d526329e9',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64250',
internalId:  '',
customField: '20100302-163459'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '64272',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64272',
internalId:  '',
customField: '20100302-164616'
};
webappMappings['7008']=webappMappings['7008-6949']={
webappId:    '7008',
documentId:  '64432',
internalId:  '6949',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64432',
internalId:  '',
customField: '20100302-164108'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INEV3E';
var companyName   = '+++++++++++++++Karen%27s+Catering';
var htmlTitle	  = 'Karen%27s+Catering';
var metaKeywords  = 'Catering+Philadelphia+Cairnwood+Wedding+ChefHilltop+House+The+Willows+Weddings';
var metaContents  = 'Chef+Catering+Karen+Weddings+';
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();
};
