/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','473',jdecode('Unser+Angebot'),jdecode(''),'/473/index.html','true',[ 
		['PAGE','494',jdecode('Brunch'),jdecode(''),'/473/494.html','true',[],'',''],
		['PAGE','19601',jdecode('Mittagessen'),jdecode(''),'/473/19601.html','true',[],'',''],
		['PAGE','36301',jdecode('Salatbuffet'),jdecode(''),'/473/36301.html','true',[],'',''],
		['PAGE','18122',jdecode('Ap%C3%A9ros'),jdecode(''),'/473/18122.html','true',[],'',''],
		['PAGE','18101',jdecode('Desserts'),jdecode(''),'/473/18101.html','true',[],'',''],
		['PAGE','515',jdecode('Hochzeitstorten'),jdecode(''),'/473/515.html','true',[],'',''],
		['PAGE','19622',jdecode('Photodruck+auf+Torte'),jdecode(''),'/473/19622.html','true',[],'',''],
		['PAGE','536',jdecode('Lebkuchen'),jdecode(''),'/473/536.html','true',[],'',''],
		['PAGE','28401',jdecode('Geschenkideen'),jdecode(''),'/473/28401.html','true',[],'','']
	],'',''],
	['PAGE','578',jdecode('Wir+%C3%BCber+uns'),jdecode(''),'/578/index.html','true',[ 
		['PAGE','23001',jdecode('Team'),jdecode(''),'/578/23001.html','true',[],'','']
	],'',''],
	['PAGE','683',jdecode('Aus-+und+Weiterbildung'),jdecode(''),'/683.html','true',[],'',''],
	['PAGE','23901',jdecode('Jobs'),jdecode(''),'/23901.html','true',[],'',''],
	['PAGE','3001',jdecode('So+finden+Sie+uns'),jdecode(''),'/3001.html','true',[],'',''],
	['PAGE','2706',jdecode('G%C3%A4stebuch'),jdecode(''),'/2706/index.html','true',[ 
		['PAGE','2701',jdecode('Eintr%C3%A4ge'),jdecode(''),'/2706/2701.html','false',[],'','']
	],'',''],
	['PAGE','662',jdecode('Kontakt'),jdecode(''),'/662.html','true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='AC2323';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='356';
theSitetree.contentColor='DDDDDD';
theSitetree.contentBGColor='AC2323';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'AC2323',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'356',
				contentColor: 	'DDDDDD',
				contentBGColor: 'AC2323',
				a_color: 		'AC2323',
				b_color: 		'480F0F',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20100504-225227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2701',
internalId:  '',
customField: '20080812-111040'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-1856141']={
webappId:    '1501',
documentId:  '401',
internalId:  '1856141',
customField: '1501'
};
webappMappings['1002']=webappMappings['1002-2706agt010in24y8']={
webappId:    '1002',
documentId:  '2706',
internalId:  '2706agt010in24y8',
customField: 'icq=false'
};
webappMappings['7008']=webappMappings['7008-1344']={
webappId:    '7008',
documentId:  '662',
internalId:  '1344',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18101',
internalId:  '',
customField: '20080930-001517'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '3001',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20100504-225621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20080929-234727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20080930-093316'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '536',
internalId:  '',
customField: '20080812-104558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19601',
internalId:  '',
customField: '20080815-212913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '578',
internalId:  '',
customField: '20090924-213702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23001',
internalId:  '',
customField: '20080930-171145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19622',
internalId:  '',
customField: '20080930-093528'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '662',
internalId:  '',
customField: '20080929-233859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '683',
internalId:  '',
customField: '20080929-230129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2706',
internalId:  '',
customField: '20080812-111040'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18122',
internalId:  '',
customField: '20080930-081912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3001',
internalId:  '',
customField: '20080929-232334'
};
webappMappings['7060']=webappMappings['7060-f20e72b012b06e9f42bed6e952dbd6e6']={
webappId:    '7060',
documentId:  '23001',
internalId:  'f20e72b012b06e9f42bed6e952dbd6e6',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23901',
internalId:  '',
customField: '20100504-220320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28401',
internalId:  '',
customField: '20100126-145050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36301',
internalId:  '',
customField: '20100504-223952'
};
var canonHostname = 'wsc.genotec.ch';
var accountId     = 'AGT010IN24Y8';
var companyName   = '...+gepflegt+verpflegt+%21';
var htmlTitle	  = '';
var metaKeywords  = 'B%C3%A4ckerei++Konditorei++Caf%C3%A9++Kaffee++Backstube++Hochzeitstorte+Hochzeit+Brunch+Kr%C3%A4henb%C3%BChl+gepflegt+verpflegt+Geburtstag+Lebkuchen+Feste+paillasse';
var metaContents  = 'Hochzeitstorte+Hochzeit+Brunch+Ap%C3%A9ro+Dessert+Caf%C3%A9+Gipfeli+Brot+Schwarzw%C3%A4lder+P%C3%A2tisserie+Belegte+Br%C3%B6tli+Canap%C3%A9s+partybrot+lebkuchen+paillasse';
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();
};

