/* [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','2201',jdecode('Home'),jdecode(''), jdecode('%2F2201.html'), 'true',[],'',''],
	['PAGE','2252',jdecode('Opening+hours'),jdecode(''), jdecode('%2F2252.html'), 'true',[],'',''],
	['PAGE','8501',jdecode('How+to+find+us'),jdecode(''), jdecode('%2F8501.html'), 'true',[ 
		['ITEM','8522',jdecode('Map'),jdecode(''), jdecode('http%3A%2F%2Fmaps.google.com%2Fmaps%3Ff%3Dq%26source%3Ds_q%26hl%3Den%26geocode%3D%26q%3D443%2BMain%2BSt%2C%2BPleasanton%2C%2BCA%2B94566%26aq%3D%26sll%3D37.71859%2C-121.992187%26sspn%3D0.002376%2C0.006453%26ie%3DUTF8%26hq%3D%26hnear%3D443%2BMain%2BSt%2C%2BPleasanton%2C%2BAlameda%2C%2BCalifornia%2B94566%26ll%3D37.66011%2C-121.876144%26spn%3D0.038051%2C0.103254%26z%3D14'), 'true',[],'','_blank']
	],'',''],
	['PAGE','2294',jdecode('Menu'),jdecode(''), jdecode('%2F2294.html'), 'true',[],'',''],
	['PAGE','11512',jdecode('Our+Desserts'),jdecode(''), jdecode('%2F11512.html'), 'true',[],'',''],
	['PAGE','2315',jdecode('Wine+List'),jdecode(''), jdecode('%2F2315.html'), 'true',[],'',''],
	['PAGE','2336',jdecode('Reservations'),jdecode(''), jdecode('%2F2336%2Findex.html'), 'true',[ 
		['ITEM','5701',jdecode('Reserve+My+Table'),jdecode(''), jdecode('http%3A%2F%2Fwww.opentable.com%2Fagora-bistro-reservations-pleasanton%3Frestref%3D54346'), 'true',[],'','_blank'],
		['PAGE','2357',jdecode('Party+Rooms'),jdecode(''), jdecode('%2F2336%2F2357.html'), 'true',[],'',''],
		['PAGE','2378',jdecode('Catering'),jdecode(''), jdecode('%2F2336%2F2378.html'), 'true',[],'','']
	],'',''],
	['PAGE','7901',jdecode('Press'),jdecode(''), jdecode('%2F7901.html'), 'true',[],'',''],
	['PAGE','2462',jdecode('Contact'),jdecode(''), jdecode('%2F2462.html'), 'true',[],'',''],
	['PAGE','2483',jdecode('About+us'),jdecode(''), jdecode('%2F2483%2Findex.html'), 'true',[ 
		['PAGE','2504',jdecode('Our+team'),jdecode(''), jdecode('%2F2483%2F2504.html'), 'true',[],'',''],
		['PAGE','2525',jdecode('Our+chef'),jdecode(''), jdecode('%2F2483%2F2525.html'), 'true',[],'','']
	],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Restaurant';
theSitetree.paletteFamily='62212A';
theSitetree.keyvisualId='11917';
theSitetree.keyvisualName='kv_11917.jpg';
theSitetree.fontsetId='33196';
theSitetree.graphicsetId='14094';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp35-attweb',
  product: 'WSCSYSSSSLY0X9RC'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Restaurant',
				paletteFamily: 	'62212A',
				keyvisualId: 	'11917',
				keyvisualName: 	'kv_11917.jpg',
				fontsetId: 		'33196',
				graphicsetId: 	'14094',
				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:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2201',
internalId:  '',
customField: '20110731-171016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2462',
internalId:  '',
customField: '20110106-192943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2294',
internalId:  '',
customField: '20110731-165325'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8501',
internalId:  '',
customField: '20110410-191258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2252',
internalId:  '',
customField: '20110731-165559'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2315',
internalId:  '',
customField: '20110226-025341'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2336',
internalId:  '',
customField: '20110505-202709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2357',
internalId:  '',
customField: '20110203-003331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2378',
internalId:  '',
customField: '20110203-003812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7901',
internalId:  '',
customField: '20110505-204249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2483',
internalId:  '',
customField: '20110203-001911'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2504',
internalId:  '',
customField: '20110203-002018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2525',
internalId:  '',
customField: '20110203-002453'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11512',
internalId:  '',
customField: '20110731-174934'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVF340I7K0OZ';
var companyName   = 'AGORA+BISTRO';
var htmlTitle	  = 'Agora';
var metaKeywords  = 'Pleasanton%2C+Mediterranean+Food%2C+Best+Musakka%2C+Musakka%2C+Kebab%2C+Kebob%2C+Greek%2C+Turkish%2C+Best+in+Town%2C+Pleasanton+Main+Street%2C+Party+in+Pleasanton%2C+Meeting+in+Pleasanton%2C+Lamb%2C+Veal+';
var metaContents  = 'Mediterranean';
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();
};

