/* [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','4611',jdecode('Home'),jdecode(''),'/4611.html','true',[],'',''],
	['PAGE','4668',jdecode('Menu'),jdecode(''),'/4668/index.html','true',[ 
		['PAGE','4695',jdecode('Breakfast'),jdecode(''),'/4668/4695.html','true',[],'',''],
		['PAGE','4722',jdecode('Lunch'),jdecode(''),'/4668/4722.html','true',[],'',''],
		['PAGE','4749',jdecode('Dinner'),jdecode(''),'/4668/4749.html','true',[],'','']
	],'',''],
	['PAGE','52463',jdecode('Happy+Hour'),jdecode(''),'/52463.html','true',[],'',''],
	['PAGE','4584',jdecode('News'),jdecode(''),'/4584.html','true',[],'',''],
	['PAGE','4803',jdecode('Contact'),jdecode(''),'/4803.html','true',[],'',''],
	['PAGE','4776',jdecode('About+us'),jdecode(''),'/4776.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Aliment';
theSitetree.paletteFamily='BD1A27';
theSitetree.keyvisualId='8107';
theSitetree.keyvisualName='kv_8107.jpg';
theSitetree.fontsetId='16993';
theSitetree.graphicsetId='12387';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='f3f2f2';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Aliment',
				paletteFamily: 	'BD1A27',
				keyvisualId: 	'8107',
				keyvisualName: 	'kv_8107.jpg',
				fontsetId: 		'16993',
				graphicsetId: 	'12387',
				contentColor: 	'000000',
				contentBGColor: 'f3f2f2',
				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:  '4611',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4611',
internalId:  '',
customField: '20091017-030343'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4584',
internalId:  '',
customField: '20091017-025821'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4776',
internalId:  '',
customField: '20090224-003117'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4668',
internalId:  '',
customField: '20091009-233016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4695',
internalId:  '',
customField: '20081112-080822'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4722',
internalId:  '',
customField: '20091009-234526'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4749',
internalId:  '',
customField: '20091006-032552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4803',
internalId:  '',
customField: '20081202-214503'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52463',
internalId:  '',
customField: '20091006-235641'
};
webappMappings['1501']=webappMappings['1501-22245761']={
webappId:    '1501',
documentId:  '4611',
internalId:  '22245761',
customField: '1501'
};
var canonHostname = 'webomat01.hostpoint.ch';
var accountId     = 'Ahp010INEQMT';
var companyName   = 'WELCOME+TO+GGs+BISTRO';
var htmlTitle	  = 'GGs+Bistro';
var metaKeywords  = 'restaurants+in+Laguna+Beach%2C+happy+hour%2C+appetizers%2C+wine%2C+beer%2C+bar%2C+cocktails%2C+kabob%2C+gyros%2C+pita+sanwiches%2C+Mediterranean+cuisine%2C+Italian+restaurants%2Cchicken+kebab%2C+humus%2C+borek+%2Cshrimp+kebab%2C+eggplant%2C+burgers%2C+pasta%2C+vegetarian+menu%2C+dinner%2C+lunch%2C+breakfast%2C+Alexander+kabob%2C+croissant%2C+bagel%2C+breakfast%2C+Turkish+restaurant%2C+gyros%2C+patio+dining%2C+pacific+coast+highway%2C+pet+friendly+restaurant%2C+kids+friendly+restaurant%2C+Baklava+shrimp%2C+kofte%2C+lamb+chops%2C+coffee%2C+California%2C+orange+county%2C+Turkish+tea%2C+Turkish+coffee%2C+Laguna+Beach+restaurants%2C+Turkish%2C+gastronomy%2C+pleasure+dining%2C+to+go+sandwiches%2C++';
var metaContents  = 'Italian+Mediterranean+restaurant+in+Laguna+Beach';
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();
};
