/* [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','3601',jdecode('Sabor+Home%21+'),jdecode(''),'/3601.html','true',[],''],
	['PAGE','13601',jdecode('Calendar'),jdecode(''),'/13601.html','true',[],''],
	['PAGE','3652',jdecode('Our+Coffee+%26+Menu'),jdecode(''),'/3652.html','true',[],''],
	['PAGE','3715',jdecode('Press'),jdecode(''),'/3715.html','true',[],''],
	['PAGE','3673',jdecode('Business+Hours'),jdecode(''),'/3673.html','true',[],''],
	['PAGE','16201',jdecode('Gallery'),jdecode(''),'/16201.html','true',[],''],
	['PAGE','3694',jdecode('Find+us'),jdecode(''),'/3694.html','true',[],''],
	['PAGE','3799',jdecode('Contact'),jdecode(''),'/3799.html','true',[],''],
	['PAGE','3736',jdecode('About+us'),jdecode(''),'/3736.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Vita02';
theSitetree.paletteFamily='F0DCB8';
theSitetree.keyvisualId='11282';
theSitetree.keyvisualName='kv_11282.jpg';
theSitetree.fontsetId='32118';
theSitetree.graphicsetId='13934';
theSitetree.contentColor='3C3D3C';
theSitetree.contentBGColor='F6FBFE';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Vita02',
				paletteFamily: 	'F0DCB8',
				keyvisualId: 	'11282',
				keyvisualName: 	'kv_11282.jpg',
				fontsetId: 		'32118',
				graphicsetId: 	'13934',
				contentColor: 	'3C3D3C',
				contentBGColor: 'F6FBFE',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3601',
internalId:  '',
customField: '20091014-183343'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3652',
internalId:  '',
customField: '20090313-163448'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3673',
internalId:  '',
customField: '20090125-200549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3694',
internalId:  '',
customField: '20090331-184218'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3799',
internalId:  '',
customField: '20090515-030434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3736',
internalId:  '',
customField: '20090125-195348'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3715',
internalId:  '',
customField: '20090331-191252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16201',
internalId:  '',
customField: '20090515-030205'
};
webappMappings['1501']=webappMappings['1501-15069053']={
webappId:    '1501',
documentId:  '3601',
internalId:  '15069053',
customField: '1501'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '3694',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['7008']=webappMappings['7008-13208']={
webappId:    '7008',
documentId:  '3601',
internalId:  '13208',
customField: 'language:en;country:US;'
};
webappMappings['7050']=webappMappings['7050-7441']={
webappId:    '7050',
documentId:  '13601',
internalId:  '7441',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13601',
internalId:  '',
customField: '20090429-193629'
};
webappMappings['7005']=webappMappings['7005-1599']={
webappId:    '7005',
documentId:  '3799',
internalId:  '1599',
customField: 'language:en;country:US;'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INEVA0';
var companyName   = 'WELCOME+TO+SABOR+Y+CULTURA%21+++++%28Hollywood+%26+Pasadena%29';
var htmlTitle	  = 'Welcome+to+Sabor+y+Cultura+cafe+coffee+house+in+Hollywood+and+Pasadena%21+';
var metaKeywords  = 'cafe%2C+caffe%2C+cafes%2C+coffees%2C+drinks%2C+Pasadena%2C+yelp%2C+coffee%2C+Hollywood%2C+Sabor+y+Cultura%2C+savor%2C+culture%2C+espresso%2C+latte%2C+lunch%2C+breakfast%2C+cafe%2C+drinks%2C+soda%2C+sandwich%2C+frozen+yogurt%2C+yogurt%2C+drinks%2C+hangout%2C+wifi%2C+internet%2C+tables%2C+meeting%2C+water%2C+celebrity%2C+movies%2C+culture%2C+savor%2C+starbucks%2C+bean%2C+latin%2C+caffe%2C+los+angeles%2C+california%2C+dessert%2C+information%2C+';
var metaContents  = 'World+Class+Espresso%21+coffee+in+Hollywood+and+Pasadena.++Latin+cafe.++Music+and+drinks.+';
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();
};
